本文整理汇总了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);
}
示例2: constructor
constructor(public router: Router) {
router.configure(config => {
config.title = 'TinyUI';
config.map([
{ route: ['','examples'], moduleId: './examples', nav: true, title:'examples' }
]);
});
}
示例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;
});
}
示例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;
});
}
示例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' }
]);
});
}
示例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;
});
}
示例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;
});
}
示例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);
}
示例9: constructor
constructor(
private sessionService: SessionService,
private router: Router) {
router.configure(routes);
}