本文整理匯總了TypeScript中angular2/router.Router類的典型用法代碼示例。如果您正苦於以下問題:TypeScript Router類的具體用法?TypeScript Router怎麽用?TypeScript Router使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了Router類的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: gotoDetail
gotoDetail() {
this._router.navigate(['BottleDetail', { id: this.selectedBottle.id }]);
}
示例2: onCancel
private onCancel() {
this.router.navigate(['Root']);
return;
}
示例3:
.then((_) => router.navigateByUrl('/abc'))
示例4: redirect
redirect(event) {
event.preventDefault();
if (!this.isLoggedIn()) {
this.router.navigate('/');
}
}
示例5: onLogout
public onLogout(){
this._gVS.setLoggedIn(false);
this._gVS.setStudentId(0);
this._router.navigate(['Login'])
}
示例6: chartOfAccounts
chartOfAccounts() {
this._router.navigate(['ChartOfAccounts']);
}
示例7:
gotoLogin() {
this._router.navigate(['Dashboard']);
}
示例8:
.subscribe(() => {
this.router.navigate(['/Home']);
}, this.handleError)
示例9: close
close() {
this.router.navigate(['/PigeonList']);
}
示例10: goToDetail
goToDetail(login: string) {
let link = ['UserDetails', { login: login }]
this._router.navigate(link);
}