當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript RouteTree.parent方法代碼示例

本文整理匯總了TypeScript中@angular/router.RouteTree.parent方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript RouteTree.parent方法的具體用法?TypeScript RouteTree.parent怎麽用?TypeScript RouteTree.parent使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在@angular/router.RouteTree的用法示例。


在下文中一共展示了RouteTree.parent方法的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']);
 }
開發者ID:yuxhuang,項目名稱:angular2-starter,代碼行數:7,代碼來源:contact-details.component.ts

示例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);
  }
開發者ID:srinathsj92,項目名稱:reflexcmpe282,代碼行數:9,代碼來源:customerDetails.component.ts

示例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;
       });   
    
 }
開發者ID:Anhmike,項目名稱:Angular2-CustomerManager,代碼行數:12,代碼來源:customerOrders.component.ts

示例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);
 }
開發者ID:leoalmeida,項目名稱:trabalhofinal,代碼行數:5,代碼來源:links.component.ts

示例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);
 }
開發者ID:taoveweb,項目名稱:angular2,代碼行數:5,代碼來源:crisis-list.component.ts

示例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);
 }
開發者ID:Akrobate,項目名稱:attractive-network,代碼行數:5,代碼來源:app.friends.ts


注:本文中的@angular/router.RouteTree.parent方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。