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


TypeScript aurelia-router.Router类代码示例

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


在下文中一共展示了Router类的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: 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

示例4: 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

示例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: activeNavItemChanged

 activeNavItemChanged(activeNavLink) {
     for (let index = 0; index < this.navItems.length; index++) {
         let navItem = this.navItems[index];
         navItem.isActive = navItem.link === activeNavLink;
     }
     this.router.navigate(activeNavLink);
 }
开发者ID:t0ms3n,项目名称:SoftwareManager,代码行数:7,代码来源:app.ts

示例7: save

    public save() {
        if (!this.canSave) {
            return;
        }

        this.storage.saveTodo(this.todo);
        this.router.navigateToRoute('list');
    }
开发者ID:Jenselme,项目名称:tests-ionic2-and-aurelia-framework7,代码行数:8,代码来源:edit.ts

示例8:

 return this.ds.login().then(user => {
   if (user) {
     this.session.setUser(user);
     return this.router.navigateToRoute("dispatch");
   } else {
     return true;
   }
 });
开发者ID:rgwch,项目名称:webelexis,代码行数:8,代码来源:stage1.ts

示例9: alert

 this.ds.login(this.username, this.password).then(user => {
   if (user) {
     this.session.setUser(user);
     this.router.navigateToRoute("dispatch");
   } else {
     alert("Username oder Passwort falsch");
   }
 });
开发者ID:rgwch,项目名称:webelexis,代码行数:8,代码来源:stage1.ts


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