当前位置: 首页>>代码示例>>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;未经允许,请勿转载。