本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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'
}]);
}
示例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"
}
]);
}
示例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`);
}
示例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;
}
示例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;
}