2
我是新来的Angular 2,我的嵌套组件不可见或甚至处理。 你能帮忙吗?我想我可能还没有宣布任何指令.... 我main.ts:嵌套组件不可见
import {bootstrap} from 'angular2/platform/browser';
import {MatchListComponent} from "./match/match.component";
import { HTTP_PROVIDERS } from 'angular2/http';
bootstrap(
MatchListComponent,
[ HTTP_PROVIDERS ]
);
我MatchListComponent看起来像这样:
@Component({
selector: "matches",
template: `
<table class="table">
<match-row *ngFor="#list of matches" match="list" >
</match-row>
</table>
`,
providers: [MatchService]
})
export class MatchListComponent implements OnInit...
不匹配行成为显示出来,但约150他们存在于DOM
Edit: match-row
@Component({
selector: "match-row",
template: `
<tr >
<td>
{{match.matchday.number}}
</td>
<td>
{{match.displayValue}}
</td>
</tr>
`,
providers: [TrainerService, MatchdayService]
})
export class MatchRowComponent ...
感谢泰勒,我已经改变了,但现在香港专业教育学院得到这个^^: '例外:模板解析错误: 属性绑定ngFor不是嵌入模板中使用任何指令( “ <! - 表 - > <表类=” 表 “> [ERROR - >] <匹配排* ngFor =” 让匹配列表” [匹配] = “列表”> “):MatchListComponent @ 11:8' –
你可以发布匹配行的代码吗? –
已添加匹配行,请参阅上面的 –