前端之家收集整理的这篇文章主要介绍了
Angular2 Router,
前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
<table class="javascript">@H_502_0@<tr class="li1">
<td class="ln"><pre class="de1">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
Component
from
ROUTER_DIRECTIVES from
Component
directives ROUTER_DIRECTIVES
selector
template `
nav
a routerLink Homea
a routerLink Abouta
a routerLink Contacta
nav
routeroutletrouteroutlet
`
AppComponent
provideRouter RouterConfig from
HomeComponent from
AboutComponent from
ContactComponent from
routeRouterConfig
path component HomeComponent
path component AboutComponent
path component ContactComponent
routerProvider
provideRouterroute
bootstrap from
AppComponent from
routerProvider from
bootstrapAppComponentrouterProvider