CT1*_*.IT 29 angularjs-ng-repeat angular
我已经阅读了与Angular 2及其ng-repeat实现相关的各种问题跟踪器条目,但是就目前而言,如果它实际存在,我实际上还没有实现.
是否可以ng-repeat在角度2中使用?
rck*_*ckd 46
我-component.ts:
import { Component } from 'angular2/core';
@Component({
selector: 'my-component',
templateUrl: './my-component.html'
})
export class MyComponent{
public values: number[] = [1, 2, 3];
}
Run Code Online (Sandbox Code Playgroud)
我-component.html:
<div *ngFor='let value of values; trackBy: index;'>
{{ value }}
</div>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
38466 次 |
| 最近记录: |