{{email|json}} - {{user|json}}
isAdmin() {
console.log(\'
Template methods will almost always be called multiple times. The same is true for *ngFor
that it is iterated over multiple times. If you have something that executes an expensive call then you should cache the result and return that either in the method or use ngOnInit to retrieve/calculate the values and set them in your component.
{{email|json}} - {{user|json}}
export class MyComponent implements OnInit {
isAdmin: boolean;
ngOnInit() {
this.isAdmin = this.bcAuthService.isAdmin();
console.log('isAdmin: ', this.isAdmin);
}
}