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


TypeScript router.RouterExtensions类代码示例

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


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

 }).then(() => {
   this._router.navigate([
     '/:target', {
       target: this.board.nextScreen
     }
   ], Config.transition);
 });
开发者ID:bradyhouse,项目名称:house,代码行数:7,代码来源:level-three.component.ts

示例4:

	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

示例5: close

 public close() {
     if (this.isModal) {
         this.params.closeCallback();
     } else {
         this.router.back();
     }
 }
开发者ID:NativeScript,项目名称:tests-app-ng,代码行数:7,代码来源:lazy.component.ts

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

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

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

示例9: getLoggedUser

 public getLoggedUser(): User {
     const loggedUser = this.repository.getLoggedUser();
     console.log("TEST")
     if (!loggedUser) {
         this.router.navigateByUrl('/login');
         return null;
     }
     return loggedUser;
 }
开发者ID:JaymePreto,项目名称:emergency193,代码行数:9,代码来源:auth.service.ts


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