angular/angular.io

blog entry contains a code example that is not working

zoechi opened this issue · 0 comments

http://angularjs.blogspot.co.at/2017/03/angular-400-now-available.html

<div *ngIf="userList | async as users; else loading">
  <user-profile *ngFor="let user of users; count as count" [user]="user">
  </user-profile>
  <div>{{count}} total users</div> <!-- outside the scope of *ngFor -->
</div>
<ng-template #loading>Loading...</ng-template>

count can only be used inside <user-profile>

See also http://stackoverflow.com/questions/43212647/angular-official-docs-ngfor-count-demo-not-working/43213156?noredirect=1#comment73498450_43213156