當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript RouterExtensions.navigate方法代碼示例

本文整理匯總了TypeScript中nativescript-angular/router.RouterExtensions.navigate方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript RouterExtensions.navigate方法的具體用法?TypeScript RouterExtensions.navigate怎麽用?TypeScript RouterExtensions.navigate使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在nativescript-angular/router.RouterExtensions的用法示例。


在下文中一共展示了RouterExtensions.navigate方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1:

 this.connectivityService.startMonitoring((newConnectionType: ConnectionType) => {
     if (newConnectionType === ConnectionType.none) {
         this.router.navigate(['/network'], { clearHistory: true, transition: { name: 'slideTop' } });
     } else {
         this.router.navigate(['/location'], { clearHistory: true, transition: { name: 'slideTop' } });
     }
 });
開發者ID:TheOriginalJosh,項目名稱:nativescript-weather,代碼行數:7,代碼來源:app.component.ts

示例2: onPlayTap

 onPlayTap() {
   this.consoleLogMsg('game.component', 'onPlayTap');
   switch(this.level) {
     case 3:
       this._router.navigate(['/level-three'], Config.transition);
       break;
     case 2:
       this._router.navigate(['/level-two'], Config.transition);
       break;
     default:
       this._router.navigate(['/level-one'], Config.transition);
       break;
   }
 }
開發者ID:bradyhouse,項目名稱:house,代碼行數:14,代碼來源:game.component.ts

示例3: canLoad

    canLoad(): boolean {
        if (getBoolean('isLoggedin')) {
            // console.log(this.logged_user_group)
            if (this.logged_user_group == undefined) {
                this._routerExtensions.navigate(["/dashboard/" + this.user_id], { clearHistory: true });
                return true;
            }
            else {
                this._routerExtensions.navigate(["/franchise-user"], { clearHistory: true });
                return true;
            }

        }
        this._routerExtensions.navigate(["/login"], { clearHistory: true });
        return false;
    }
開發者ID:tonmoy-sardar,項目名稱:banao.app,代碼行數:16,代碼來源:auth.guard.ts

示例4: launchExample

 public launchExample() {
     if (hasKey("gotoexample")) {
         let value = getString("gotoexample");
         remove("gotoexample");
         this.router.navigate([value]);
     }
 }
開發者ID:yirony199,項目名稱:nativescript-sdk-examples-ng,代碼行數:7,代碼來源:app.component.ts

示例5: checkConnection

	checkConnection() {
		var connection: ConnectionType = this.getConnectionType();
		console.log('checkConnecton', connection)
		if (connection == ConnectionType.none) {
			this.router.navigate(['/network'], { clearHistory: true });
		}
	}
開發者ID:TheOriginalJosh,項目名稱:nativescript-weather,代碼行數:7,代碼來源:connection.service.ts

示例6:

 }).then(() => {
   this._router.navigate([
     '/:target', {
       target: this.board.nextScreen
     }
   ], Config.transition);
 });
開發者ID:bradyhouse,項目名稱:house,代碼行數:7,代碼來源:level-three.component.ts

示例7: flipToNextPage

    // << router-page-back

    // >> router-page-transition-code
    flipToNextPage() {
        this.routerExtensions.navigate(["/main"], {
            transition: {
                name: "flip",
                duration: 2000,
                curve: "linear"
            }
        });
    }
開發者ID:NathanWalker,項目名稱:nativescript-angular,代碼行數:12,代碼來源:router-extensions.ts

示例8: onAddTap

 onAddTap(): void {
   let options: NavigationOptions = { 
     clearHistory: true               
   };                                 
   
   this.routerExtensions.navigate(
     ["detail", this.pages.length],   
     options); 
 }
開發者ID:mikebranstein,項目名稱:NativeScriptInAction,代碼行數:9,代碼來源:list.component.ts

示例9: canActivate

 canActivate() {
     if (this.loginService.isLogged) {
         console.log("GUARD: authenticated");
         return true;
     }
     else {
         console.log("GUARD: redirecting to login");
         this.nav.navigate(["/login"]);
         return false;
     }
 }
開發者ID:evenkeeler,項目名稱:nativescript-angular,代碼行數:11,代碼來源:login-test.ts


注:本文中的nativescript-angular/router.RouterExtensions.navigate方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。