首页 > 代码库 > Angular4 step by step.3
Angular4 step by step.3
1.Routes 路由模块
1 import { NgModule } from ‘@angular/core‘; 2 import { RouterModule, Routes } from ‘@angular/router‘; 3 4 import { DashboardComponent } from ‘./dashboard.component‘; 5 import { HeroesComponent } from ‘./heroes.component‘; 6 import { HeroDetailComponent } from ‘./hero-detail.component‘; 7 8 const routes: Routes = [ 9 { path: ‘‘, redirectTo: ‘/dashboard‘, pathMatch: ‘full‘ }, 10 { path: ‘dashboard‘, component: DashboardComponent }, 11 { path: ‘detail/:id‘, component: HeroDetailComponent }, 12 { path: ‘heroes‘, component: HeroesComponent } 13 ]; 14 15 @NgModule({ 16 imports: [ RouterModule.forRoot(routes) ], 17 exports: [ RouterModule ] 18 }) 19 export class AppRoutingModule {}
2.路由模块还是蛮绕的,看了2天
3.
4.哇哈哈截图留念
Angular4 step by step.3
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。