Template , View. But if i change *ngIf directive to [hidden] property, it looks nice, and there is no null item.
Asked
Active
Viewed 247 times
0
-
2Welcome to StackOverflow. Please add code directly to the question instead of linking to external resources. – Günter Zöchbauer Apr 24 '16 at 11:15
-
seems like you don't even need that `ngIf` , `ngFor` doesn't render if `length` is `0` – Ankit Singh Apr 24 '16 at 11:24
1 Answers
2
try using this if you are using below beta 8, because angular2 does't support *ngIf anf *ngFor on same element beta 8(see here ) and below -
<template [ngIf]='hotel.rooms.length > 0'>
<div *ngFor='#room of hotel.rooms; #i=index'>
... Your code
</div>
</template>
Hope it helps you, if not provide your code as plnkr ill help you.

Pardeep Jain
- 84,110
- 37
- 165
- 215