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