码迷,mamicode.com
首页 > 其他好文 > 详细

Angular4 step by step.3

时间:2017-08-12 12:49:11      阅读:130      评论:0      收藏:0      [点我收藏+]

标签:redirect   技术   isp   tin   import   rom   open   tail   color   

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 {}
View Code

2.路由模块还是蛮绕的,看了2天

3.技术分享

4.哇哈哈截图留念

技术分享

 

Angular4 step by step.3

标签:redirect   技术   isp   tin   import   rom   open   tail   color   

原文地址:http://www.cnblogs.com/welanshan/p/7349669.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!