Angular2 *ngIf check object array length in template
<p>Refered to <a href="https://angular.io/docs/ts/latest/guide/displaying-data.html" rel="noreferrer">https://angular.io/docs/ts/latest/guide/displaying-data.html</a> and stack <a href="https://stackoverflow.com/questions/37111005/how-to-check-empty-object-in-angular-2-template-using-ngif">How to check empty object in angular 2 template using *ngIf</a> still getting syntax error self context undefined. If I remove *ngIf condition then I am getting values in teamMembers if I push some value into it so I can access values in teamMembers.</p>

<p>my <code>teamMember</code> object is <code>[ ] array</code> i am trying to check condition array is empty by size.</p>

<p>Tries : </p>

<pre><code>&lt;div class="row" *ngIf="(teamMembers | json) != '{}'"&gt;
</code></pre>

<p>and</p>

<pre><code>&lt;div class="row" *ngIf="teamMembers.length &gt; 0"&gt; //Check length great than
                                                 throwing syntax error
            &lt;div class="col-md-12"&gt;
                &lt;h4&gt;Team Members&lt;/h4&gt;
                &lt;ul class="avatar" *ngFor="let member of teamMembers"&gt;
                    &lt;li&gt;&lt;a href=""&gt;&lt;gravatar-image [size]="80" [email]="member.email"&gt;&lt;/gravatar-image&gt;&lt;/a&gt;&lt;/li&gt;
                &lt;/ul&gt;
            &lt;/div&gt;
        &lt;/div&gt;
</code></pre>

<p>Component :</p>

<pre><code>@Component({
selector: 'pbi-editor',
})
export class AppComponent implements OnInit {
teamMembers: User[];
</code></pre>

<p>Any help would be great.</p>