/
partyUninvited.ts
48 lines (39 loc) · 1.03 KB
/
partyUninvited.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import * as angular from 'angular';
import * as angularMeteor from 'angular-meteor';
import { Component, Input } from '@angular/core';
import { MeteorComponent } from 'angular2-meteor';
import { Meteor } from 'meteor/meteor';
import template from './partyUninvited.html';
@Component({
template,
selector: 'party-uninvited'
})
export class PartyUninvited extends MeteorComponent {
@Input() party: any;
constructor() {
super();
this.autorun(() => {
this.users = Meteor.users.find({}).fetch();
});
}
invite(user) {
Meteor.call('invite', this.party._id, user._id,
(error) => {
if (error) {
console.log('Oops, unable to invite!');
} else {
console.log('Invited!');
}
}
);
}
}
const name = 'partyUninvited';
// create a module
export const PartyUninvitedNg1Module = angular.module(name, [
angularMeteor
]);
export function registerPartyUninvited(adapter) {
PartyUninvitedNg1Module
.directive(name, adapter.downgradeNg2Component(PartyUninvited))
}