本文整理汇总了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' } });
}
});
示例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;
}
}
示例3:
}).then(() => {
this._router.navigate([
'/:target', {
target: this.board.nextScreen
}
], Config.transition);
});
示例4:
checkConnection() {
var connection: ConnectionType = this.getConnectionType();
console.log('checkConnecton', connection)
if (connection == ConnectionType.none) {
this.router.navigate(['/network'], { clearHistory: true });
}
}
示例5: close
public close() {
if (this.isModal) {
this.params.closeCallback();
} else {
this.router.back();
}
}
示例6: launchExample
public launchExample() {
if (hasKey("gotoexample")) {
let value = getString("gotoexample");
remove("gotoexample");
this.router.navigate([value]);
}
}
示例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;
}
示例8: flipToNextPage
// << router-page-back
// >> router-page-transition-code
flipToNextPage() {
this.routerExtensions.navigate(["/main"], {
transition: {
name: "flip",
duration: 2000,
curve: "linear"
}
});
}
示例9: getLoggedUser
public getLoggedUser(): User {
const loggedUser = this.repository.getLoggedUser();
console.log("TEST")
if (!loggedUser) {
this.router.navigateByUrl('/login');
return null;
}
return loggedUser;
}