Refered to https://angular.io/docs/ts/latest/guide/displaying-data.html and stack How to check empty object in angular 2 template using *ngIf still getting syntax error self
You can use
Without event.attendees?.length > 0 or even event.attendees?length != 0 Because ?.length already return boolean value. If in array will be something it will display it else not. 0 讨论(0) 查看其它5个回答 发布评论: 提交评论 加载中... 验证码 看不清? 提交回复
Without event.attendees?.length > 0 or even event.attendees?length != 0
event.attendees?.length > 0
event.attendees?length != 0
Because ?.length already return boolean value.
?.length
If in array will be something it will display it else not.