Angular中Router使用教學

Router 主要 Component

 





首先,在app.module.ts中加入Router module, 並建立Router規則,接著在@NgModule中加入routes















最後,在要使用Router的地方加入<router-outlet>,這裡我們在app.component.html中使用





接著,我們就可以使用<routerLink>變換<router-outlet>中的內容(對照前面routes<path, component>)





留言

這個網誌中的熱門文章

在windows 10上安裝mmdetection