{ provide: 'CanActivateForLoggedIn', useValue: () => !! Meteor.userId() }
ngOnInit(){ this.userid = this.route.snapshot.params['userid']; this.cur_user = typeof this.userid === "undefined" || this.userid === null || this.userid === Meteor.userId(); }
this.zone.run(() => { this.currentUser = Meteor.user(); this.currentUserId = Meteor.userId(); this.isLoggingIn = Meteor.loggingIn(); this.isLoggedIn = !!Meteor.user(); })
useValue: () => !!Meteor.userId()
routerOnActivate(next: ComponentInstruction, prev: ComponentInstruction) { if (Meteor.userId() === null) { this.router.navigate(['Login']); } }
// Unsubscribe user from conversation function unsubscribeConversation(reference:string){ ConversationStreams.update({'_id':reference, 'subscribers':{$elemMatch: {'user':Meteor.userId()}}}, { $set : {'subscribers.$.subscribed':0} }); }
private userMutedNotifications(): boolean { const userConfiguration = UserConfigurations.findOne({userId: Meteor.userId()}); return userConfiguration && userConfiguration.muteNotifications; }
constructor (private params: RouteParams) { let deckId = params.get('deckId'); this.words = Words.find( { $and: [ { creator: Meteor.userId() }, { deckid: deckId } ] } ); }
sendMessage(conversationID, message){ this.call('sendMessage', conversationID, Meteor.userId(), message); this.reply = ''; }
This paragraph has some \`code\` in it. This paragraph has some \`code\` in it. ![Alt Text](http://placehold.it/200x50 "Image Title") ![Alt Text](http://placehold.it/200x50 "Image Title") ` }; Meteor.methods({ seedPosts() { let userId = Meteor.userId(); if (!userId) { return; } if (Posts.find({ author: userId, removed: false }).count() === 0) { posts.forEach((post) => { Meteor.call('createPost', post); }); } }, removeAllPosts() { let userId = Meteor.userId(); if (!userId) {