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' –
你可以發佈匹配行的代碼嗎? –
已添加匹配行,請參閱上面的 –