本文整理汇总了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();
}