title: Angular *ngIf binding to function
body: <p>I would like to ask about *ngIf binding to function return value. Will it have performance overhead when comparing *ngIf binding to property. </p>
  
  <p>This is only sample code for asking concept, the data structure is complex than that in DataService. The enable flag will be saved in a map object. This is just a simple expression: </p>
  
  <p>In typescript service</p>
  
  <pre><code>export class DataService() {
     private enable: boolean;
  
     isEnable() {
        return enable;
     }
  
     getEnableValue() {
        return enable;
     }
  
     update(flag: boolean) {
        enable = flag;
     }
  }
  </code></pre>
  
  <p>In html,</p>
  
  <pre><code>&lt;div *ngIf="isEnable()"&gt;
      &lt;p&gt; {{ testObject.value }}&lt;/p&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>In typescript,</p>
  
  <pre><code>isEnable() {
     return this.dataService.isEnable();
  }
  </code></pre>
  
  <p>vs </p>
  
  <p>In html, </p>
  
  <pre><code>&lt;div *ngIf="isEnable"&gt;
      &lt;p&gt; {{ testObject.value }}&lt;/p&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>In typescript, </p>
  
  <pre><code>isEnable: boolean;
  ngOnInit() {
      isEnable = this.dataService.getEnableValue()
  }
  </code></pre>
  
  <p>For *ngIf="isEnable", I am able to understand。 But for function binding，is angular check the property in the function and monitor it changes? Any performance difference? </p>
  
  <p>Thanks a lot.</p>