[Angular2 Router] Index router
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.
[Angular2 Router] Index router的更多相关文章
- router.go,router.push,router.replace的区别
除了使用 <router-link> 创建 a 标签来定义导航链接,我们还可以借助 router 的实例方法,通过编写代码来实现.当你点击 <router-link> 时,这个 ...
- vue & vue router & dynamic router
vue & vue router & dynamic router https://router.vuejs.org/guide/essentials/dynamic-matching ...
- [Angular2 Router] Programmatic Router Navigation via the Router API - Relative And Absolute Router Navigation
In this tutorial we are going to learn how to navigate programmatically (or imperatively) by using t ...
- angular2 学习笔记 ( Router 路由 )
参考 : https://angular.cn/docs/ts/latest/guide/router.html#!#can-activate-guard https://angular.cn/doc ...
- vue - src for components || router(index.js)
描述:重新编写一个组件 1.1 编写一个PrintName.vue <!--这里是模板 --> <template> <div class="hello&quo ...
- vue router.push(),router.replace(),router.go()和router.replace后需要返回两次的问题
转载:https://www.cnblogs.com/lwwen/p/7245083.html https://blog.csdn.net/qq_15385627/article/details/83 ...
- vue router.push(),router.replace(),router.go()
1.router.push(location)=====window.history.pushState 想要导航到不同的 URL,则使用 router.push 方法.这个方法会向 history ...
- $router和router区别
this.$router.push({path:'/'})//这个是js编程式的一种动态跳转路由方式,是全局的路由对象. 而写在router声明文件中的router是自己定义实例化的一个对象.可以使用 ...
- react+redux教程(四)undo、devtools、router
上节课,我们介绍了一些es6的新语法:react+redux教程(三)reduce().filter().map().some().every()....展开属性 今天我们通过解读redux-undo ...
随机推荐
- TCP连接状态详解
tcp状态: LISTEN:侦听来自远方的TCP端口的连接请求 SYN-SENT:再发送连接请求后等待匹配的连接请求 SYN-RECEIVED:再收到和发送一个连接请求后等待对方对连接请求的确认 ES ...
- Unable to find required classes (javax.activation.DataHandler and javax.mail.internet.MimeMultipart). Attachment support is disa
转自:https://blog.csdn.net/ouyangtianhan/article/details/6797999 Unable to find required classes (java ...
- android webview 报 [ERROR:in_process_view_renderer.cc(189)] Failed to request GL process. Deadlock likely: 0 问题
工作中遇到 使用webview中加载含有audio标签的页面时提示[ERROR:in_process_view_renderer.cc(189)] Failed to request GL proce ...
- 轻松八步搞定Cacti配置安装(原创视频)
轻松八步搞定Cacti配置安装 1.安装web server $sudo apt-get install apache2 验证 http://localhost 2.$sudo apt-get ins ...
- Kinect开发 —— 基础知识
转自:http://www.cnblogs.com/yangecnu/archive/2012/04/02/KinectSDK_Application_Fundamentals_Part2.html ...
- 迅雷云监工crysadm搭建
之前在淘宝众筹买了个迅雷赚钱宝Pro,2016年01月到手,玩了半个月. 之后在看百度贴吧时,看到好多大神都在用PC上用网页版软件来管理赚钱宝.非常是好奇.搜索了非常多资料,基本上都已经过时了.都无法 ...
- iOS 创建静态库文件时去掉当中的Symbols
在project中创建静态库文件时.默认会将一些Symbols加到静态库文件里.这样做有两个缺点: 1.假设引用静态库文件的project中发生了bug.就会直接跳转到静态库的源代码. 也许有人问:静 ...
- web显示winform,web打开winform,IE打开winform
前言:为什么要用ie打开winform 个人觉得,winform部署client太麻烦如金蝶··用友,winfrom打补丁太麻烦,加入新功能再部署很费时间:于是就想为什么不能用IE打开呢?这样就不须要 ...
- 为RecyclerView添加item的点击事件
RecyclerView侧重的是布局的灵活性,虽说可以替代ListView但是连基本的点击事件都没有,这篇文章就来详细讲解如何为RecyclerView的item添加点击事件,顺便复习一下观察者模式. ...
- powerdesigner逆向自动生成mysql说明文档、PDM
做EDI的项目的时候,用到相关工具powerdesigner,正好我们的一个项目对数据设计阶段时相关文档没有很好的保存下来,查找了一下powderdesigner相关文档,采用逆向工程,从mysql数 ...