当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript RouterConfiguration.map方法代码示例

本文整理汇总了TypeScript中aurelia-router.RouterConfiguration.map方法的典型用法代码示例。如果您正苦于以下问题:TypeScript RouterConfiguration.map方法的具体用法?TypeScript RouterConfiguration.map怎么用?TypeScript RouterConfiguration.map使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在aurelia-router.RouterConfiguration的用法示例。


在下文中一共展示了RouterConfiguration.map方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: configureRouter

 public configureRouter(routerConfiguration: RouterConfiguration, router: Router): void {
     routerConfiguration.options.pushState = true;
     let routes: RouteConfig[] = [{
         name: "welcome",
         title: "Welcome",
         route: "/",
         nav: true,
         moduleId: "./welcome"
     }, {
         name: "questions",
         title: "Questions App",
         route: "/questions",
         nav: true,
         moduleId: "../questions/app",
         settings: { childRoutes: questionsRoutes }
     }, {
         name: "users",
         title: "Users App",
         route: "/path/to/users",
         nav: true,
         moduleId: "../users/app",
         settings: { childRoutes: usersRoutes }
     }];
     routerConfiguration.map(routes);
     this.routeMapper.map(routes);
     this.router = router;
 }
开发者ID:heruan,项目名称:aurelia-route-mapper-example,代码行数:27,代码来源:app.ts

示例2: configureRouter

 async configureRouter(config:RouterConfiguration, router:Router) {
     this.currentLoggedUser = await this.userService.getCurrentLoggedUser();
     config.map(
         [
             {
                 route: ['', 'all'],
                 name: 'All',
                 title: 'All',
                 moduleId: './all/tweets',
                 nav: true,
                 settings: {currentUser: this.currentLoggedUser}
             },
             {
                 route: 'favourite',
                 moduleId: './favourites/tweets',
                 name: 'My favourite tweets',
                 title: 'Favourite tweets',
                 nav: true,
                 settings: {currentUser: this.currentLoggedUser}
             },
             {
                 route: 'hot',
                 name: 'Hot',
                 title: 'Hot',
                 moduleId: './hot/hotMenu',
                 nav: true
             }
         ]
     );
     this.router = router;
 }
开发者ID:m4riusz,项目名称:Twitter,代码行数:31,代码来源:tweets.ts

示例3: configureRouter

  configureRouter(config: RouterConfiguration, router: Router) {
    config.title = 'Splitterino';
    config.map([
      {
        route: ['', 'categories'],
        name: 'categories',
        moduleId: 'widgets/categories',
        nav: true,
        title: 'Categories'
      },
      {
        route: ['category/:name'],
        name: 'category',
        moduleId: 'widgets/category',
        nav: false,
        title: 'Category'
      },
      {
        route: ['timer'],
        name: 'timer',
        moduleId: 'widgets/timer',
        nav: true,
        title: 'Timer'
      },
    ]);

    this.router = router;
    this.confirmer = confirmer;
    this.messages = messageManager.messages;
  }
开发者ID:lietu,项目名称:splitterino,代码行数:30,代码来源:app.ts

示例4: configureRouter

 async configureRouter(config:RouterConfiguration, router:Router) {
     this.currentLoggedUser = await this.userService.getCurrentLoggedUser();
     config.map(
         [
             {
                 route: ['', 'latest'],
                 name: 'Latest',
                 title: 'Latest',
                 moduleId: './latest/comments',
                 nav: true,
                 settings: {currentUser: this.currentLoggedUser}
             },
             {
                 route: 'oldest',
                 moduleId: './oldest/comments',
                 name: 'Oldest',
                 title: 'Oldest',
                 nav: true,
                 settings: {currentUser: this.currentLoggedUser}
             },
             {
                 route: 'popular',
                 name: 'Popular',
                 title: 'Popular',
                 moduleId: './popular/comments',
                 nav: true,
                 settings: {currentUser: this.currentLoggedUser}
             }
         ]
     );
     this.router = router;
 }
开发者ID:m4riusz,项目名称:Twitter,代码行数:32,代码来源:commentMenu.ts

示例5: configureRouter

 async configureRouter(config:RouterConfiguration, router:Router) {
     this.currentLoggedUser = await this.userService.getCurrentLoggedUser();
     config.map([
         {
             route: ['', 'tweets'],
             moduleId: '../tweets/userTweets',
             nav: true,
             title: 'Tweets from user',
             settings: {currentUser: this.currentLoggedUser}
         },
         {
             route: 'followers',
             moduleId: './followers/userFollowers',
             nav: true,
             title: 'User followers',
             settings: {currentUser: this.currentLoggedUser}
         },
         {
             route: 'following',
             moduleId: './followings/userFollowing',
             nav: true,
             title: 'User following users',
             settings: {currentUser: this.currentLoggedUser}
         }
     ]);
     this.router = router;
 }
开发者ID:m4riusz,项目名称:Twitter,代码行数:27,代码来源:user.ts

示例6: configureRouter

 configureRouter(config: RouterConfiguration, router: Router) {
     config.title = 'Sump Pump Monitor';
     config.map([{
         route: [ '', 'home' ],
         name: 'home',
         settings: { icon: 'home' },
         moduleId: '../home/home',
         nav: true,
         title: 'Home'
     }, {
         route: 'pump/:id/',
         name: 'pumpdetail',
         settings: { icon: 'edit' },
         moduleId: '../pump/pumpdetail',
         nav: false,
         title: 'Pump Data'
     }, {
         route: 'pump/edit/:id/',
         name: 'pumpedit',
         settings: { icon: 'edit' },
         moduleId: '../pump/pumpedit',
         nav: false,
         title: 'Edit Pump'
     }]);
 }
开发者ID:NickSchweitzer,项目名称:SumpPumpMonitor,代码行数:25,代码来源:app.ts

示例7: configureRouter

 configureRouter(config: RouterConfiguration, router: Router) {
     this.router = router;
     config.title = "Capital Area .NET User Group";
     config.addPipelineStep("authorize", ToastNavResult);
     //config.options.pushState = true;
     config.map([
         { route: ["", "events"],
         viewPorts: { mainContent: {moduleId: "./events/events"}, sideBar: {moduleId: "./sideBar/sponsors"}},
         name: "Events", title: "Events", nav: true },
         { route: "jobs",
         viewPorts: { mainContent: {moduleId: "./jobs/jobs"}, sideBar: {moduleId: "./sideBar/sponsors"}},
         name: "jobs", title: "Jobs", nav: true},
         { route: "discussions",
         viewPorts: { mainContent: {moduleId: "./discussions/discussions"}, sideBar: {moduleId: "./sideBar/ads"}},
         name: "Discussions", title: "Discussions", nav:true },
         { route: "eventDetail/:eventId",
         viewPorts: { mainContent: {moduleId: "./events/eventDetail"}, sideBar: {moduleId: "./sideBar/ads"}},
         name: "eventDetail"
         },
         { route: "addJob",
           viewPorts: { mainContent: { moduleId: "./jobs/addJob " }, sideBar: { moduleId: "./sideBar/ads" } },
           name: "addJob"
         }
     ]);
 }
开发者ID:rajajhansi,项目名称:communityapp-aurelia-tswebpack,代码行数:25,代码来源:shell.ts

示例8: configure

	configure(config: RouterConfiguration) {
		config.options.pushState = true;
		config.map([
			{
				route: ["", "home"],
				title: "Home",
				name: consts.routeStates.home,
				moduleId: `${consts.basePath}/areas/home/home`,
				nav: false,
				settings: {}
			}, {
				route: "heroes",
				title: "Heroes",
				name: consts.routeStates.heroesLayout,
				moduleId: `${consts.basePath}/areas/hero/hero-layout`,
				nav: true,
				settings: {}
			}, {
				route: "basic-form",
				title: "Basic Form",
				name: consts.routeStates.basicForm,
				moduleId: `${consts.basePath}/areas/basic-form/basic-form`,
				nav: true,
				settings: {}
			}, {
				route: "route-builder",
				title: "Route builder lab",
				name: consts.routeStates.routeBuilder,
				moduleId: `${consts.basePath}/areas/route-builder/route-builder.component`,
				nav: true,
				settings: {}
			}
		]);
		config.mapUnknownRoutes(`${consts.basePath}/areas/error/not-found`);
	}
开发者ID:sketch7,项目名称:ssv-au-dojo,代码行数:35,代码来源:app.router.ts

示例9: configureRouter

  configureRouter(config: RouterConfiguration, router: Router) {
    config.title = `Atma's Massage`;
    config.map([
        {
            route: ['', 'welcome'],
            name: 'welcome',
            moduleId: 'welcome/welcome',
            nav: true,
            title: 'Welcome'
        },
        {
            route: 'new-clients',
            name: 'new-clients',
            moduleId: 'newClients/new-clients',
            nav: true,
            title: 'New Clients'
        },
        {
            route: 'packages',
            name: 'packages',
            moduleId: 'packages/packages',
            nav: true,
            title: 'Specials'
        },
        {
            route: 'about',
            name: 'about',
            moduleId: 'about/about',
            nav: true,
            title: 'About'
        }
    ]);

    this.router = router;
  }
开发者ID:tokulmassage,项目名称:tokulmassage.github.io,代码行数:35,代码来源:app.ts

示例10: configureRouter

  configureRouter(config: RouterConfiguration, router: Router) {
    this.config = config;
    config.title = this.title || 'Catalogue';

    config.addPipelineStep('authorize', AuthenticateStep); // Add a route filter to the authorize extensibility point.

    config.map([
      { route: 'tasks',              name: 'tasks',          moduleId: 'tasks',          nav: true,  title: 'Tasks & Gaps' },
      { route: 'hazards',            name: 'hazards',        moduleId: 'incidents',      nav: true,  title: 'Hazards & Risks'},
      { route: 'ci',                 name: 'ci',             moduleId: 'ci',             nav: true,  title: 'Critical Infrastructures' },
      { route: 'projects',           name: 'projects',       moduleId: 'projects',       nav: true,  title: 'Projects & Products' },
      { route: ['', 'about'],        name: 'about',          moduleId: 'welcome',        nav: true,  title: 'About' },
      { route: 'project/:id',        name: 'project',        moduleId: 'projectDetails', nav: false, title: 'Project details' },
      { route: 'editproject/:id',    name: 'editproject',    moduleId: 'projectEdit',    nav: false, title: 'Edit project', auth: true },
      { route: 'login',              name: 'login',          moduleId: 'login',          nav: false, title: 'Login' },
      { route: 'logout',             name: 'logout',         moduleId: 'logout',         nav: false, title: 'Logout' },
      { route: 'profile',            name: 'profile',        moduleId: 'profile',        nav: false, title: 'Profile'},
      { route: 'users',              name: 'users',          moduleId: 'users',          nav: false, title: 'Users', auth: true },
      { route: 'signup',             name: 'signup',         moduleId: 'signup',         nav: false, title: 'Sign up' }
   // { route: 'users',              name: 'users',          moduleId: 'users',          nav: true,  title: 'Github Users' },
      // { route: 'child-router',       name: 'child-router',   moduleId: 'child-router',   nav: true,  title: 'Child Router' }
    ]);

    this.router = router;
  }
开发者ID:TNOCS,项目名称:catalogue,代码行数:25,代码来源:app.ts


注:本文中的aurelia-router.RouterConfiguration.map方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。