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


TypeScript Router.configure方法代码示例

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


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

示例1: prepare

    prepare() {
        if (this.router.isConfigured) {
            return;
        }

        this.router.configure((config: RouterConfiguration) => {
            config.title = 'Aurelia';
            config.map([
                { route: ['', 'login'], name: 'login', moduleId: 'login' },
                { route: 'page1', name: 'page1', moduleId: 'page1', settings: { auth: true } },
                { route: 'page2', name: 'page2', moduleId: 'page2', settings: { auth: true } }
            ]);
            config.addAuthorizeStep(AuthPlugin);

            return config;
        });

        let callback = (eventArgs: Object, name) => {
            logger.warn(eventArgs['instruction']['config']['name'], name);
        };

        this.eventAggregator.subscribe('router:navigation:processing', callback);
        this.eventAggregator.subscribe('router:navigation:error', callback);
        this.eventAggregator.subscribe('router:navigation:canceled', callback);
        this.eventAggregator.subscribe('router:navigation:success', callback);
        this.eventAggregator.subscribe('router:navigation:complete', callback);
    }
开发者ID:codeaid,项目名称:skeleton-navigation,代码行数:27,代码来源:router-config.ts

示例2: constructor

 constructor(public router: Router) {
   router.configure(config => {
     config.title = 'TinyUI';
     config.map([
       { route: ['','examples'],  moduleId: './examples',      nav: true, title:'examples' }
     ]);
   });
 }
开发者ID:giabao,项目名称:tinyui-doc,代码行数:8,代码来源:app.ts

示例3: loadRouter

    private loadRouter() {
        this.router.configure((config: RouterConfiguration): RouterConfiguration => {
            config.title = "Aurelia";
            config.map([
                { route: ['', 'dash'], name: 'dash', moduleId: './views/dashboard/dash', nav: true, title: 'Dashboard' },

            ]);
            return config;
        });
    }
开发者ID:cloudspire,项目名称:Aurelia_Scaffolding,代码行数:10,代码来源:app.ts

示例4: constructor

 constructor(private router: Router) {
   this.router.configure(config => {
     config.title = "Teatr";
     config.map([
       { route: ["", "home"], name: "home", moduleId: "views/home", nav: true, title: "Home" },
       { route: "manage", name: "manage", moduleId: "views/manage", nav: true, title: "Manage" }
     ]);
     return config;
   });
 }
开发者ID:alisabzevari,项目名称:Teatr,代码行数:10,代码来源:app.ts

示例5: constructor

 constructor(private router: Router) {
   this.router = router;
   this.router.configure(config => {
     config.title = 'Aurelia';
     config.map([
       { route: ['','welcome'],  moduleId: './welcome',      nav: true, title:'Welcome' },
       { route: 'flickr',        moduleId: './flickr',       nav: true },
       { route: 'child-router',  moduleId: './child-router', nav: true, title:'Child Router' }
     ]);
   });
 }
开发者ID:searus,项目名称:skeleton-navigation,代码行数:11,代码来源:app.ts

示例6: configure

  configure() {
    this.router.configure((config: RouterConfiguration) => {
      config.title = 'Aurelia';
      //config.addPipelineStep('authorize', AuthenticateStep);

      config.map([
        { route: ['', 'welcome'], moduleId: './routes/welcome', nav: true, title: 'Welcome' },
        { route: 'users', name: 'users', moduleId: './routes/users', nav: true, title: 'Github Users', auth: true },
        { route: 'todo', name: 'todo', moduleId: './routes/todo', nav: true, title: 'ToDo Items', auth: true },
        { route: 'child-router', moduleId: './routes/child-router', nav: true, title: 'Child Router' }
      ]);
      return config;
    });
  }
开发者ID:SoftwareMasons,项目名称:aurelia-openiddict,代码行数:14,代码来源:app.router.config.ts

示例7: configure

 configure(){
   this.router.configure(config => {
     config.title = 'Aurelia';
     //config.addPipelineStep('authorize', AuthorizeStep);
     config.map([
       { route: ['','home'],  name: 'home', moduleId: './home', nav: true, title:'home' },
       { route: 'inputtext',  name: 'inputtext', moduleId: './components/inputtext/inputtext',  nav: true, title:'inputtext' },
       { route: 'autocomplete',  name: 'autocomplete', moduleId: './components/autocomplete/autocomplete',  nav: true, title:'autocomplete' },
       { route: 'calendar',  name: 'calendar', moduleId: './components/calendar/calendar',  nav: true, title:'calendar' },
       { route: 'checkbox',  name: 'checkbox', moduleId: './components/checkbox/checkbox',  nav: true, title:'checkbox' },
       { route: 'editor',  name: 'editor', moduleId: './components/editor/editor',  nav: true, title:'editor' },
       { route: 'listbox',  name: 'editor', moduleId: './components/listbox/listbox',  nav: true, title:'listbox' },
     ]);
     return config;
   });
 }
开发者ID:hwaastad,项目名称:aurelia-primeui-webpack,代码行数:16,代码来源:app.router.config.ts

示例8: configure

  configure() {
	  let appRouterConfig: any = function(config: RouterConfiguration): void {
	    config.title = 'Aurelia';
			config.addPipelineStep('authorize', AuthorizeStep); // Add a route filter to the authorize extensibility point.

	    config.map([
        { route: ['', 'welcome'], name: 'welcome',      moduleId: PLATFORM.moduleName('./welcome'),                 nav: true,  title: 'Welcome' },
        { route: 'child-router',  name: 'child-router', moduleId: PLATFORM.moduleName('./child-router'),            nav: true,  title: 'Child Router' },
        { route: 'login',         name: 'login',        moduleId: PLATFORM.moduleName('./modules/auth/login'),      nav: false, title: 'Login' },
        { route: 'logout',        name: 'logout',       moduleId: PLATFORM.moduleName('./modules/auth/logout'),     nav: false, title: 'Logout' },
        { route: 'profile',       name: 'profile',      moduleId: PLATFORM.moduleName('./modules/auth/profile'),    nav: false, title: 'Profile' },
        { route: 'signup',        name: 'signup',       moduleId: PLATFORM.moduleName('./modules/auth/signup'),     nav: false, title: 'Signup' },
        { route: 'contacts',      name: 'contacts',     moduleId: PLATFORM.moduleName('./modules/contacts/index'),  nav: true,  title: 'Contacts',  auth: true },
        { route: 'customers',     name: 'customers',    moduleId: PLATFORM.moduleName('./modules/customers/index'), nav: true, 	title: 'CRM', 			auth: true },
        { route: 'todos',         name: 'todos',        moduleId: PLATFORM.moduleName('./modules/todos/index'),     nav: true,  title: 'TODOs',			auth: true }
      ]);
	  };

    this.router.configure(appRouterConfig);
	}
开发者ID:ghiscoding,项目名称:Realtime-TODO-Aurelia-RethinkDB,代码行数:20,代码来源:app-router-config.ts

示例9: constructor

 constructor(
     private sessionService: SessionService,
     private router: Router) {
   router.configure(routes);
 }
开发者ID:devkat,项目名称:calendar,代码行数:5,代码来源:backend.ts


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