Skip to content

Commit

Permalink
Step 14.23: Create component
Browse files Browse the repository at this point in the history
  • Loading branch information
Kamil Kisiela authored and DAB0mB committed Dec 14, 2016
1 parent f9d63d3 commit 28e9757
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions imports/ui/components/partyUnanswered/partyUnanswered.js
@@ -0,0 +1,39 @@
import angular from 'angular';
import angularMeteor from 'angular-meteor';
import _ from 'underscore';

import { Meteor } from 'meteor/meteor';

import template from './partyUnanswered.html';
import { name as DisplayNameFilter } from '../../filters/displayNameFilter';

class PartyUnanswered {
getUnanswered() {
if (!this.party || !this.party.invited) {
return;
}

return this.party.invited.filter((user) => {
return !_.findWhere(this.party.rsvps, { user });
});
}

getUserById(userId) {
return Meteor.users.findOne(userId)
}
}

const name = 'partyUnanswered';

// create a module
export default angular.module(name, [
angularMeteor,
DisplayNameFilter
]).component(name, {
template,
controllerAs: name,
bindings: {
party: '<'
},
controller: PartyUnanswered
});

0 comments on commit 28e9757

Please sign in to comment.