Angular 2中是否存在ngRepeat?

前端之家收集整理的这篇文章主要介绍了Angular 2中是否存在ngRepeat?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我已经阅读了与Angular 2相关的各种问题跟踪器条目及其ng-repeat的实现,但是就目前而言,如果它实际存在,我实际上并未解决

是否可以在角度2中使用ng-repeat?

Angular 2.0发布

我-component.ts:

  1. import { Component } from 'angular2/core';
  2.  
  3. @Component({
  4. selector: 'my-component',templateUrl: './my-component.html'
  5. })
  6. export class MyComponent{
  7. public values: number[] = [1,2,3];
  8. }

我-component.html:

  1. <div *ngFor='let value of values; trackBy: index;'>
  2. {{ value }}
  3. </div>

猜你在找的Angularjs相关文章