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


TypeScript Router.navigateByInstruction方法代码示例

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


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

示例1: goToCustomer

    public goToCustomer(partnerId: number) {
        var instructions = this._router.root.generate(['/Customer', {
            id: partnerId
        }]);

        this._dossierService.createDossier(instructions, 'Kunde');
        this._router.navigateByInstruction(instructions);
    }
开发者ID:LVM-IT,项目名称:spa-prototype,代码行数:8,代码来源:mailbox.ts

示例2: onTap

 /**
  * onTap function will check _preFunction first 
  * then do the navigation.
  */
 onTap(): void {
   if(this._preFunction) {
     Promise.resolve(this._preFunction()).then((res) => {
       this._router.navigateByInstruction(this._navigationInstruction);
     });
   } else {
     this._router.navigateByInstruction(this._navigationInstruction);
   }
 }
开发者ID:xzry6,项目名称:customizedRouterLink,代码行数:13,代码来源:wasabi-router-link.ts

示例3: goToContract

    public goToContract(partnerId: number, contractId: number) {
        var instructions = this._router.root.generate(['/Customer', {
            id: partnerId
        }, 'Contract', {
            category: 'vertrag',
            categoryId: contractId
        }]);

        this._dossierService.createDossier(instructions, 'Kunde');
        this._router.navigateByInstruction(instructions);
    }
开发者ID:LVM-IT,项目名称:spa-prototype,代码行数:11,代码来源:mailbox.ts

示例4:

  				.then((result) => {
  					if (result) {
							if (!auth.isAdmin) {
								router.navigateByInstruction(router.generate(['/Restricted']), true);
								return false;
							}

  						return true;
  					} else {
							router.navigate(['/Login', {target}]);
  						return false;
  					}
  				});
开发者ID:tkssharma,项目名称:Angular-2-with-gulp,代码行数:13,代码来源:is-logged-in.ts

示例5: routerOnActivate

  routerOnActivate(next: ComponentInstruction, prev: ComponentInstruction) {
    if (window.confirm('Are you sure you want to logout?')) {
      this.auth.logout();
    }

    if (prev) {
      let previous = new ResolvedInstruction(prev, null, {});
      this.router.navigateByInstruction(previous);
    } else {
      this.router.navigate(['/Home']);
    }


    return false;
  }
开发者ID:tkssharma,项目名称:Angular-2-with-gulp,代码行数:15,代码来源:logout.ts

示例6: navigateToMailbox

    public navigateToMailbox() {
        this._interactionService.requestSave();

        let caption = 'Briefkasten',
            instructions = this._router.generate(['/Mailbox']);

        const dossiers = this._dossierService.getAll();
        const dossier = dossiers.find(d => d.caption === caption);

        if (!dossier) {
            this._dossierService.createDossier(instructions, caption);
        }

        this._router.navigateByInstruction(instructions);

    }
开发者ID:LVM-IT,项目名称:spa-prototype,代码行数:16,代码来源:appmenu.ts

示例7:

 Promise.resolve(this._preFunction()).then((res) => {
   this._router.navigateByInstruction(this._navigationInstruction);
 });
开发者ID:xzry6,项目名称:customizedRouterLink,代码行数:3,代码来源:wasabi-router-link.ts

示例8:

 .then((carrier: RouteInstruction)=> {
     this._outstandingChildRoutingUrl = carrier.outstandingPath;
     return this._router.navigateByInstruction(carrier.instruction);
 })
开发者ID:LVM-IT,项目名称:spa-prototype,代码行数:4,代码来源:recursive.router.ts

示例9: onTap

 onTap(): void {
     log("NSRouterLink onTap() instruction: " + JSON.stringify(this._navigationInstruction))
     this._router.navigateByInstruction(this._navigationInstruction);
 }
开发者ID:ImNitinNayar7,项目名称:nativescript-angular,代码行数:4,代码来源:ns-router-link.ts

示例10: navigatePage

 navigatePage(id) {
   let instruction = this.router.generate(['../PostsPage', { id: id }]);
   this.router.navigateByInstruction(instruction);
 }
开发者ID:kentoo,项目名称:ng2-wp-blog,代码行数:4,代码来源:posts.component.ts


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