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


TypeScript router-deprecated.RouteParams类代码示例

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


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

示例1: constructor

    constructor(private movieData: MovieService,
                private params: RouteParams,
                private router: Router) {

        this.movieData.getById(params.get("id"))
            .subscribe(movie => {
                this.movie = movie;   
            });
        
    }
开发者ID:zulfeekar,项目名称:ngclass,代码行数:10,代码来源:details.component.ts

示例2: constructor

  constructor(params: RouteParams, ngZone: NgZone) {
    var partyId = params.get('partyId');


    Tracker.autorun(() => {
      ngZone.run(() => {
        this.party = Parties.findOne(partyId);
      });
    });
  }
开发者ID:hhkk,项目名称:160522_socially,代码行数:10,代码来源:party-details.ts

示例3: constructor

  constructor(params: RouteParams) {
    var partyId = params.get('partyId');
    this.party = Parties.findOne(partyId);

    let fb = new FormBuilder();
    this.partyForm = fb.group({
     name: [''],
     description: [''],
     location: ['']
    });
  }
开发者ID:ijager,项目名称:Socially-Step8,代码行数:11,代码来源:party-details.ts

示例4: search

  search(): void {
    this.query = this.routeParams.get('query');
    if (!this.query) {
      return;
    }

    this.spotify
      .searchTrack(this.query)
      .subscribe((res: any) => this.renderResults(res));
  }
开发者ID:GerbenRampaart,项目名称:ngbook2,代码行数:10,代码来源:SearchComponent.ts

示例5: ngOnInit

 ngOnInit() {
     let id: number = +this._routeParams.get('id')
     if( id > 0) {
         if(!this.contact || this.contact.id != id)
             this.contact = this._personService.getById(+id)
     } else if(id===-1) {
         this.contact = {id: null, firstName: '', lastName: '', email: ''}
         this.showEdit = true
     }
 }
开发者ID:pracxs,项目名称:angular-2-sofia,代码行数:10,代码来源:contact-details.component.ts

示例6: _initModel

  private _initModel(): void {
    let endpoint = '/users/' + this._routeParams.get('id')

    this._service
      .get(endpoint)
      .subscribe((user: User) => {
        user.birthday = this._datePipe.transform(user.birthday, 'DD/MM/YYYY')
        this.model = user
      })
  }
开发者ID:emesonsantana,项目名称:bmp1-web-service,代码行数:10,代码来源:edit.component.ts

示例7: ngOnInit

    ngOnInit() {

        this.chamada = {
            'id': null,
            'slug': "",
            'titulo': "",
            'texto': "",
            'midia': "",
            'aceitaInscricao': false
        };

        if (this._routeParams.get('slug') != null) {
            this.slug = this._routeParams.get('slug');
            this._chamadaService.findChamadaBySlug(this.slug).subscribe(res => this.chamada = res);
        }

        this.captura = { idChamada: null, email: "" };

    }
开发者ID:rodrigocipriani,项目名称:poderdarede,代码行数:19,代码来源:chamada-detail.component.ts

示例8: ngOnInit

 ngOnInit() {
     let id = +this.routeParams.get('id');
     this.service.getMovie(id).then(movie => {
         if(movie){
             this.editRating = movie.rating;
             this.movie = movie;
         } else {
             this.gotoMovies();
         }
     });
 }
开发者ID:Valumior,项目名称:MoviesShowsAng2,代码行数:11,代码来源:movie-detail.component.ts

示例9: ngOnInit

 // #docregion ngOnInit
 ngOnInit() {
   let id = +this._routeParams.get('id');
   this._service.getCrisis(id).then(crisis => {
     if (crisis) {
       this.editName = crisis.name;
       this.crisis = crisis;
     } else { // id not found
       this.gotoCrises();
     }
   });
 }
开发者ID:GeertJohan,项目名称:angular.io,代码行数:12,代码来源:crisis-detail.component.1.ts

示例10: ngOnInit

 ngOnInit() {
     let id = +this.routeParams.get('id');
     this.service.getShow(id).then(show => {
         if(show){
             this.editRating = show.rating;
             this.show = show;
         } else {
             this.gotoShows();
         }
     });
 }
开发者ID:Valumior,项目名称:MoviesShowsAng2,代码行数:11,代码来源:show-detail.component.ts


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