0

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

030
  • 10,842
  • 12
  • 78
  • 123

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
  • 84,110
  • 37
  • 165
  • 215