當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。