本文整理匯總了TypeScript中@angular/router-deprecated.Router類的典型用法代碼示例。如果您正苦於以下問題:TypeScript Router類的具體用法?TypeScript Router怎麽用?TypeScript Router使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了Router類的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: back
back() {
this._router.navigate(['Show', { id: this._routeParams.get('id') }])
}
示例2: isCurrentRoute
isCurrentRoute(route){
var instruction = this.router.generate(route);
return this.router.isRouteActive(instruction);
}
示例3: Route
.then((_) => rtr.config([new Route({path: '/...', component: LifecycleCmp})]))
示例4: onSelectFactory
onSelectFactory(factory: Factory) {
console.log('Selected factory code: ' + factory.code + ', factory name: ' + factory.name);
this._router.navigate(['FactorySummary', { code: factory.code } ]);
}
示例5: gotoServicesGroupDetail
gotoServicesGroupDetail(servicesGroup: ServicesGroup){
let link = ['ServicesGroupDetailsPage', { url: servicesGroup.url }];
this._router.navigate(link);
}
示例6: gotoCatalog
gotoCatalog(board: Board) {
let link = ['Threads', { board_id: board.board_id }];
this.router.navigate(link);
}
示例7: signup
signup(event) {
event.preventDefault();
this.router.navigateByUrl('/signup');
}
示例8: gotoDetail
gotoDetail(hero: Hero){
let link = ['HeroDetail',{id: hero.id}];
this.router.navigate(link);
}
示例9: volver
private volver() {
event.preventDefault();
// this.router.parent.navigateByUrl('/login');
this.router.navigate(['Login']);
}
示例10: submit
submit(query: string): void {
this.router.navigate(['/Search', {query: query}]);
this.search();
}