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的更多相关文章

  1. router.go,router.push,router.replace的区别

    除了使用 <router-link> 创建 a 标签来定义导航链接,我们还可以借助 router 的实例方法,通过编写代码来实现.当你点击 <router-link> 时,这个 ...

  2. vue & vue router & dynamic router

    vue & vue router & dynamic router https://router.vuejs.org/guide/essentials/dynamic-matching ...

  3. [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 ...

  4. angular2 学习笔记 ( Router 路由 )

    参考 : https://angular.cn/docs/ts/latest/guide/router.html#!#can-activate-guard https://angular.cn/doc ...

  5. vue - src for components || router(index.js)

    描述:重新编写一个组件 1.1 编写一个PrintName.vue <!--这里是模板 --> <template> <div class="hello&quo ...

  6. 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 ...

  7. vue router.push(),router.replace(),router.go()

    1.router.push(location)=====window.history.pushState 想要导航到不同的 URL,则使用 router.push 方法.这个方法会向 history ...

  8. $router和router区别

    this.$router.push({path:'/'})//这个是js编程式的一种动态跳转路由方式,是全局的路由对象. 而写在router声明文件中的router是自己定义实例化的一个对象.可以使用 ...

  9. react+redux教程(四)undo、devtools、router

    上节课,我们介绍了一些es6的新语法:react+redux教程(三)reduce().filter().map().some().every()....展开属性 今天我们通过解读redux-undo ...

随机推荐

  1. Self-Taught Learning

    the promise of self-taught learning and unsupervised feature learning is that if we can get our algo ...

  2. pwconv---pwunconv 密码投影

    pwconv命令用来开启用户的投影密码.Linux系统里的用户和群组密码,分别存放在名称为passwd和group的文件中, 这两个文件位于/etc目录下.因系统运作所需,任何人都得以读取它们,造成安 ...

  3. 【Pycharm】【HTML】注释问题

    学习HTML中,遇到的注释前存在空行的问题: 只要找到Pycharm设置中:勾选去掉即可

  4. 【CS Round #39 (Div. 2 only) B】Circle Elimination

    [Link]:https://csacademy.com/contest/round-39/task/circle-elimination/ [Description] [Solution] 把n个点 ...

  5. 洛谷——P3384 【模板】树链剖分

    https://www.luogu.org/problem/show?pid=3384#sub 题目描述 如题,已知一棵包含N个结点的树(连通且无环),每个节点上包含一个数值,需要支持以下操作: 操作 ...

  6. bitset也挺好用的

    http://www.cplusplus.com/reference/bitset/bitset/bitset/ std::bitset<16> foo; std::bitset<4 ...

  7. BASH 文本模版的简单实现 micro_template_compile

    详细代码 ############################### # # Funciton: micro_template_compile # # Parameter: # [1] => ...

  8. 轻松学习Linux之Shell的常用过滤器

    下载高清视频: http://down.51cto.com/data/157818    大小3:MB      时长: 7分钟 更多内容见: Linux爱好者的圣诞大餐-轻松学习Linux系列多媒体 ...

  9. JavaScript--Module模式

    //module: Module模式是JavaScript编程中一个非常通用的模式 window.onload = function() { //1.基本使用: var MyFn = function ...

  10. 图片拖拽缩放功能:兼容Chrome、Firefox、IE8+

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...