,在該文件中
Dashboard.Component.ts
定義一個@Component與選擇但文件的.html 在沒有相應的選擇器,你可以解釋我怎麼可能? 你沒有被迫定義選擇器標籤?
,在該文件中
Dashboard.Component.ts
定義一個@Component與選擇但文件的.html 在沒有相應的選擇器,你可以解釋我怎麼可能? 你沒有被迫定義選擇器標籤?
路由器使用ViewContainerRef.createComponent()
,它不需要選擇器來匹配HTML。舉例來說,另請參閱Angular 2 dynamic tabs with user-click chosen components。
DashboardComponent
用於Router
。路由器組件不需要selector
屬性。
的角度路由器可以讓你的路線到一個組件直接 - 看看應用程序/應用-routing.module.ts: { path: 'dashboard', component: DashboardComponent },
參見本「添加路由」鏈接查看更多細節: https://angular.io/docs/ts/latest/tutorial/toh-pt5.html
您連接了錯誤的Plnkr。 –
該死的是空的 –
更新了url –