当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript router.RouteParams类代码示例

本文整理汇总了TypeScript中angular2/router.RouteParams的典型用法代码示例。如果您正苦于以下问题:TypeScript RouteParams类的具体用法?TypeScript RouteParams怎么用?TypeScript RouteParams使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了RouteParams类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: constructor

 constructor(routeParams:RouteParams, private pictureservice:PictureService) {
   this.id = routeParams.get('id');
 }
开发者ID:hollannikas,项目名称:ssoidh-angular2,代码行数:3,代码来源:picture.component.ts

示例2: constructor

 constructor(private _service:BooksService,
             private _router:Router,
             routeParams:RouteParams) {
     this._selectedId = +routeParams.get('id');
 }
开发者ID:PawelPisarek,项目名称:DTTA_KSIEGARNIA,代码行数:5,代码来源:borrow-list.component.ts

示例3: constructor

 constructor(
   private _questionnaireService:QuestionnaireService,
   routeParams:RouteParams) {
   this._id = routeParams.get('id');
 }
开发者ID:panrenliang,项目名称:ng2book-part3-demo,代码行数:5,代码来源:published.ts

示例4: ngOnInit

 ngOnInit() {
   // Notice how we extract the id by calling the RouteParams.get method.
   let id = +this._routeParams.get('id'); // The hero id is a number. Route parameters are always strings. So we convert the route parameter value to a number with the JavaScript (+) operator.
   this._heroService.getHero(id)
     .then(hero => this.hero = hero);
 }
开发者ID:irstacks,项目名称:angular2-heroes,代码行数:6,代码来源:hero-detail.component.ts

示例5: constructor

 constructor(params: RouteParams, phones: Phones) {
     phones.getPhone({ phoneId: params.get("phoneId") }).then((phone) => {
         this.phone = phone;
         this.mainImageUrl = phone.images[0];
     });
 }
开发者ID:rushi216,项目名称:angular-migration,代码行数:6,代码来源:phoneDetail.component.ts

示例6: ngOnInit

 ngOnInit():any {
     let itemIndex = this._routerParams.get('recipeIndex');
     this._recipeIndex = itemIndex;
     this.recipe = this._recipeService.getRecipe(+itemIndex) || null;
 }
开发者ID:Feling,项目名称:RecipeBook,代码行数:5,代码来源:recipe-detail.component.ts

示例7:

 _dataService.events$.map(events => events.find(event => event.id === _params.get('id')));
开发者ID:Brocco,项目名称:houston,代码行数:1,代码来源:event-edit.ts

示例8: ngOnInit

 ngOnInit() {
   // convert the route parameter value to a number with the JavaScript (+) operator.
   let id = +this._routeParams.get('id');
   this._heroService.getHero(id)
     .then(hero => this.hero = hero);
 }
开发者ID:DermotMurphy,项目名称:angular2-tour-of-heroes,代码行数:6,代码来源:hero-detail.component.ts

示例9: ngOnInit

 ngOnInit() {
     let id = +this.routeParams.get('id');
     this.postService.getPost(id)
         .subscribe(post => this.post = post);
 }
开发者ID:herasimau,项目名称:blog-app,代码行数:5,代码来源:post-detail.component.ts

示例10: ngOnInit

 ngOnInit():any {
     this.newSoldier = {name: this._routeParams.get('name'), power: null, health: null};
 }
开发者ID:weicheng2138,项目名称:angular2-practice,代码行数:3,代码来源:new-soldier.component.ts


注:本文中的angular2/router.RouteParams类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。