Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Step 6.13: Subscribe to get the partyId
- Loading branch information
1 parent
0961f24
commit 3312474
Showing
1 changed file
with
17 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,24 @@ | ||
import { Component } from '@angular/core'; | ||
import { Component, OnInit } from '@angular/core'; | ||
import { ActivatedRoute } from '@angular/router'; | ||
|
||
import 'rxjs/add/operator/map'; | ||
|
||
import template from './party-details.component.html'; | ||
|
||
@Component({ | ||
selector: 'party-details', | ||
template | ||
}) | ||
export class PartyDetailsComponent {} | ||
export class PartyDetailsComponent implements OnInit { | ||
partyId: string; | ||
|
||
constructor( | ||
private route: ActivatedRoute | ||
) {} | ||
|
||
ngOnInit() { | ||
this.route.params | ||
.map(params => params['partyId']) | ||
.subscribe(partyId => this.partyId = partyId); | ||
} | ||
} |