【发布时间】:2017-10-02 03:33:45
【问题描述】:
//appcomponent.ts
import { Component } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
heroes=[{name:"superman"},{name:"heman"}];
}
//app.component.html
<ul><li *ngfor="let hero of heroes">{{hero.name}}</li></ul>
此代码不起作用,并给我空白输出。如果您对此有解决方案。请告诉我
【问题讨论】:
-
*ngFor而不是*ngfor? -
*ngFor 不是 *ngfor
-
谢谢 picci ...
标签: angular angular2-template angular2-forms