app/dashboard.component.ts (metadata)
@Component({
moduleId: module.id, //将 moduleId
属性设置为 module.id
就可以加载
templateUrl模板及相关的module
selector: 'my-dashboard',
templateUrl: 'dashboard.component.html',
})
2、模板文件
app/dashboard.component.html
<h3>Top Heroes</h3>
<div class="grid grid-pad">
<div *ngFor="let hero of heroes" class="col-1-4">
<div class="module hero">
<h4>{{hero.name}}</h4>
</div>
</div>
</div>