本文整理汇总了TypeScript中meteor/meteor.Meteor.userId方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Meteor.userId方法的具体用法?TypeScript Meteor.userId怎么用?TypeScript Meteor.userId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类meteor/meteor.Meteor
的用法示例。
在下文中一共展示了Meteor.userId方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1:
{ provide: 'CanActivateForLoggedIn', useValue: () => !! Meteor.userId() }
示例2: ngOnInit
ngOnInit(){
this.userid = this.route.snapshot.params['userid'];
this.cur_user = typeof this.userid === "undefined" || this.userid === null || this.userid === Meteor.userId();
}
示例3:
this.zone.run(() => {
this.currentUser = Meteor.user();
this.currentUserId = Meteor.userId();
this.isLoggingIn = Meteor.loggingIn();
this.isLoggedIn = !!Meteor.user();
})
示例4:
useValue: () => !!Meteor.userId()
示例5: routerOnActivate
routerOnActivate(next: ComponentInstruction, prev: ComponentInstruction) {
if (Meteor.userId() === null) {
this.router.navigate(['Login']);
}
}
示例6: unsubscribeConversation
// Unsubscribe user from conversation
function unsubscribeConversation(reference:string){
ConversationStreams.update({'_id':reference, 'subscribers':{$elemMatch: {'user':Meteor.userId()}}}, {
$set : {'subscribers.$.subscribed':0}
});
}
示例7: userMutedNotifications
private userMutedNotifications(): boolean {
const userConfiguration = UserConfigurations.findOne({userId: Meteor.userId()});
return userConfiguration && userConfiguration.muteNotifications;
}
示例8: constructor
constructor (private params: RouteParams) {
let deckId = params.get('deckId');
this.words = Words.find( { $and: [ { creator: Meteor.userId() }, { deckid: deckId } ] } );
}
示例9: sendMessage
sendMessage(conversationID, message){
this.call('sendMessage', conversationID, Meteor.userId(), message);
this.reply = '';
}
示例10: seedPosts
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) {