[Angular2 Router] Index router
2024-08-31 20:05:09
Index router as default router.
import {RouterModule} from "@angular/router";
import {NotFoundComponent} from "./shared-components/not-found/not-found.component"; const indexRoute = {path: '', redirectTo: 'home', pathMatch: 'full'};
const fallbackRoute = {path: '**', component: NotFoundComponent};
const routes = [
{path: 'legacy-url', redirectTo: '/home', pathMatch: 'prefix'},
{path: 'home', loadChildren: 'app/home/home.module', name: 'Home'},
{path: 'heros', loadChildren: 'app/heros/heros.module', name: 'Heros'},
{path: 'contact', loadChildren: 'app/contact/contact.module', name: 'Contact'},
{path: 'message', loadChildren: 'app/message/message.module', name: 'Message'},
{path: 'playground', loadChildren: 'app/playground/playground.module', name: 'Playground'},
{path: 'realtime', loadChildren: 'app/realtime/realtime.module', name: 'Realtime'},
{path: 'wiki-path', loadChildren: 'app/auxroute/auxroute.module', name: 'WikiDetail', outlet: 'wiki'},
{path: 'courses', loadChildren: 'app/courses/courses.module', name: 'Courses'},
indexRoute,
fallbackRoute,
]; export default RouterModule.forRoot(routes, {useHash: true});
Index router, usually comes as last, just right before the fallback router.
最新文章
- jquery ripples水波纹效果( 涟漪效果)
- 北大poj- 1028
- .html()和.text()的区别
- sourcesafe.light 开源项目启动
- Java Collection好文章
- HTML5 Socket通信
- 修改UISearBar的文字颜色,placehoder颜色及输入框颜色
- VC++深入详解-第一章学习心得(二)
- WinpCap 使用线程发数,明明发了,返回值0是OK的啊,怎么抓包看不到,难道不支持多线程。。。
- C/C++中define的使用
- Java通过axis调用.NET WebService
- MYSQL中的普通索引,主健,唯一,全文索引区别
- JSTL c标签,fn标签,fmt标签 - 生活在爪洼岛上 - ITeye技术网站
- k-means算法概述
- Beautiful Dream hdu3418 (直接做或二分)
- ( ! ) Parse error: syntax error, unexpected '' (T_ENCAPSED_AND_WHITESPACE), expecting identifier (T_STRING) or variable (T_VARIABLE) or number (T_NUM_STRING) in D:\demo\code\yolo\index\index.php on li
- Linux(二十一)Shell编程
- django插入数据库错误:mysql的1267错误
- PAT 1011 A+B和C
- [security] security engine things