matrix-dimension/web/app/admin/terms/terms.component.ts
2019-06-30 23:05:33 -06:00

30 lines
903 B
TypeScript

import { Component, OnInit } from "@angular/core";
import { ToasterService } from "angular2-toaster";
import { FE_TermsEditable } from "../../shared/models/terms";
import { AdminTermsApiService } from "../../shared/services/admin/admin-terms-api.service";
@Component({
templateUrl: "./terms.component.html",
styleUrls: ["./terms.component.scss"],
})
export class AdminTermsComponent implements OnInit {
public isLoading = true;
public policies: FE_TermsEditable[];
constructor(private adminTerms: AdminTermsApiService,
private toaster: ToasterService) {
}
public ngOnInit() {
this.adminTerms.getAllPolicies().then(policies => {
this.policies = policies;
this.isLoading = false;
}).catch(err => {
console.error(err);
this.toaster.pop("error", "Failed to load policies");
});
}
}