當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。