title: get total data after of filter data with * ngIf
body: <p>basically I have an array with data.</p>
  
  <pre><code>aData=[
   {"name":"marge"},
   {"name":"homer"},
   {"name":"bart"},
   {"name":"homer"},
   {"name":"lisa"
  ]
  </code></pre>
  
  <p>I'm filtering where the name is equal to "homer". </p>
  
  <pre><code>&lt;p&gt;Total data is {{i}}&lt;/p&gt;
  &lt;div *ngFor="let item of aData; let i=index"&gt;
    &lt;span *ngIf="item.name='homer'"&gt;&lt;/span&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>to show the total length of the elements filtered elsewhere.</p>
  
  <pre><code> &lt;p&gt;Total data is {{i}}&lt;/p&gt; //this result is blank
  </code></pre>
  
  <p>My data is dynamic, not always the result is 2 (in this case)</p>
  
  <p>how can I do it?</p>