本文整理匯總了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);
}