本文整理汇总了TypeScript中@angular/router.RouteTree类的典型用法代码示例。如果您正苦于以下问题:TypeScript RouteTree类的具体用法?TypeScript RouteTree怎么用?TypeScript RouteTree使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了RouteTree类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: routerOnActivate
routerOnActivate(curr:RouteSegment, prev?:RouteSegment, currTree?:RouteTree, prevTree?:RouteTree):void {
const id = Number(curr.getParam('id'));
this._contactsService.getContact(id).subscribe(contact => this.contact = contact);
this.baseSegments = currTree.parent(curr).urlSegments.map((x: UrlSegment) => x.segment);
this.baseSegments.unshift('/');
this.editSegments = this.baseSegments.concat(['edit']);
}
示例2: routerOnActivate
routerOnActivate(current: RouteSegment, prev?: RouteSegment,
currTree?: RouteTree, prevTree?: RouteTree) {
const id = +currTree.parent(current).getParam('id');
console.log("Getting data for user with ID = ", id);
this.dataService.getCustomer(id)
.subscribe((customer: ICustomer) => this.customer = customer);
}
示例3: routerOnActivate
routerOnActivate(current: RouteSegment, prev?: RouteSegment,
currTree?: RouteTree, prevTree?: RouteTree) {
this.user = this.authService.user;
const id = +currTree.parent(current).getParam('id');
this.dataService.getCustomer(id)
.subscribe((customer: ICustomer) => {
this.customer = customer;
});
}
示例4: routerOnActivate
routerOnActivate(curr: RouteSegment, prev: RouteSegment, currTree: RouteTree) {
this.currSegment = curr;
this.selectedId = +currTree.parent(curr).getParam('id');
//this.service.getAllMenuItems().then(list => this.itemList = list);
}
示例5: routerOnActivate
routerOnActivate(curr: RouteSegment, prev: RouteSegment, currTree: RouteTree) {
this.currSegment = curr;
this.selectedId = +currTree.parent(curr).getParam('id');
this.service.getCrises().then(crises => this.crises = crises);
}
示例6: routerOnActivate
routerOnActivate(curr: RouteSegment, prev: RouteSegment, currTree: RouteTree) {
this.currSegment = curr;
this.selectedId = +currTree.parent(curr).getParam('id');
this.service.getFriends().subscribe(friends => this.friends = friends);
}