Does ngRepeat exist in Angular 2?
From alpha 28 to 30 it's the following syntax:
import { NgFor } from 'angular2/angular2';
@View({ directives: [NgFor] })
<div *ng-for="#item of items">
Angular 2.0 Release
my-component.ts:
import { Component } from 'angular2/core';
@Component({
selector: 'my-component',
templateUrl: './my-component.html'
})
export class MyComponent{
public values: number[] = [1, 2, 3];
}
my-component.html:
<div *ngFor='let value of values; trackBy: index;'>
{{ value }}
</div>