using a function in *ngIf runs several times instead of once

前端 未结 3 853
野性不改
野性不改 2021-01-21 03:48

Template

{{email|json}} - {{user|json}}

Component

isAdmin() {
    console.log(\'         


        
3条回答
  •  我在风中等你
    2021-01-21 04:04

    Now you don't have method(member instead) and it's not spamming "isAdmin: true" but it's not means that problem is resolved.

    You can be interested in changeDetection of the component and ChangeDetectorRef to actually tell angular when isAdmin is changed to update template(detectChanges).

提交回复
热议问题