0

Template , View. But if i change *ngIf directive to [hidden] property, it looks nice, and there is no null item.

030
  • 9,351
  • 10
  • 70
  • 110

1 Answers1

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
  • 78,495
  • 36
  • 155
  • 210