Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Step 6.15: Load party details
  • Loading branch information
kamilkisiela authored and dotansimha committed Nov 27, 2016
1 parent 3b0befd commit 6e4f8f6
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions client/imports/app/parties/party-details.component.ts
@@ -1,9 +1,12 @@
import { Component, OnInit, OnDestroy } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { Subscription } from 'rxjs/Subscription';
import { Subscription } from 'rxjs/Subscription';

import 'rxjs/add/operator/map';

import { Parties } from '../../../../both/collections/parties.collection';
import { Party } from '../../../../both/models/party.model';

import template from './party-details.component.html';

@Component({
Expand All @@ -13,6 +16,7 @@ import template from './party-details.component.html';
export class PartyDetailsComponent implements OnInit, OnDestroy {
partyId: string;
paramsSub: Subscription;
party: Party;

constructor(
private route: ActivatedRoute
Expand All @@ -21,7 +25,11 @@ export class PartyDetailsComponent implements OnInit, OnDestroy {
ngOnInit() {
this.paramsSub = this.route.params
.map(params => params['partyId'])
.subscribe(partyId => this.partyId = partyId);
.subscribe(partyId => {
this.partyId = partyId

this.party = Parties.findOne(this.partyId);
});
}

ngOnDestroy() {
Expand Down

0 comments on commit 6e4f8f6

Please sign in to comment.