Permalink
Browse files

Step 16.3: Add isOwner property

  • Loading branch information...
1 parent 0ea19f2 commit 827c3007b755b13eb21b597fa185aab39b9f9a58 @dotansimha dotansimha committed with DAB0mB Sep 27, 2016
Showing with 7 additions and 0 deletions.
  1. +7 −0 client/imports/app/parties/party-details.component.ts
@@ -4,6 +4,7 @@ import { Observable } from 'rxjs/Observable';
import { Subscription } from 'rxjs/Subscription';
import { Meteor } from 'meteor/meteor';
import { MeteorObservable } from 'meteor-rxjs';
+import { InjectUser } from "angular2-meteor-accounts-ui";
import 'rxjs/add/operator/map';
@@ -18,13 +19,15 @@ import template from './party-details.component.html';
selector: 'party-details',
template
})
+@InjectUser('user')
export class PartyDetailsComponent implements OnInit, OnDestroy {
partyId: string;
paramsSub: Subscription;
party: Party;
partySub: Subscription;
users: Observable<User>;
uninvitedSub: Subscription;
+ user: Meteor.User;
constructor(
private route: ActivatedRoute
@@ -99,6 +102,10 @@ export class PartyDetailsComponent implements OnInit, OnDestroy {
});
}
+ get isOwner(): boolean {
+ return this.party && this.user && this.user._id === this.party.owner;
+ }
+
ngOnDestroy() {
this.paramsSub.unsubscribe();
this.partySub.unsubscribe();

0 comments on commit 827c300

Please sign in to comment.