当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript Meteor.userId方法代码示例

本文整理汇总了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() }
开发者ID:Tallyb,项目名称:meteor-angular2.0-socially,代码行数:1,代码来源:app.routes.ts

示例2: ngOnInit

 ngOnInit(){
   this.userid = this.route.snapshot.params['userid'];
   this.cur_user = typeof this.userid === "undefined" || this.userid === null || this.userid === Meteor.userId();
 }
开发者ID:cemersoz,项目名称:tuxlab-app,代码行数:4,代码来源:account.ts

示例3:

 this.zone.run(() => {
   this.currentUser = Meteor.user();
   this.currentUserId = Meteor.userId();
   this.isLoggingIn = Meteor.loggingIn();
   this.isLoggedIn = !!Meteor.user();
 })
开发者ID:Anhmike,项目名称:angular2-shop,代码行数:6,代码来源:login-buttons.ts

示例4:

 useValue: () => !!Meteor.userId()
开发者ID:babyshoes,项目名称:exquisite-corpus,代码行数:1,代码来源:app.routes.ts

示例5: routerOnActivate

 routerOnActivate(next: ComponentInstruction, prev: ComponentInstruction) {
   if (Meteor.userId() === null) {
     this.router.navigate(['Login']);
   }
 }
开发者ID:RizkiMufrizal,项目名称:Socially-Angular2-Meteor,代码行数:5,代码来源:secure-component.ts

示例6: unsubscribeConversation

// Unsubscribe user from conversation
function unsubscribeConversation(reference:string){
	ConversationStreams.update({'_id':reference, 'subscribers':{$elemMatch: {'user':Meteor.userId()}}}, {
		$set : {'subscribers.$.subscribed':0}
	});
}
开发者ID:gab3alm,项目名称:lemonaidev3,代码行数:6,代码来源:conversation-methods.ts

示例7: userMutedNotifications

	private userMutedNotifications(): boolean {
		const userConfiguration = UserConfigurations.findOne({userId: Meteor.userId()});

		return userConfiguration && userConfiguration.muteNotifications;
	}
开发者ID:clesquir,项目名称:js-volemon,代码行数:5,代码来源:GameNotifier.ts

示例8: constructor

	constructor (private params: RouteParams) {
		let deckId = params.get('deckId');
  	this.words = Words.find( { $and: [ { creator:  Meteor.userId() }, { deckid: deckId  } ] } );
	}
开发者ID:adwaitsharma,项目名称:web-flashcards,代码行数:4,代码来源:word-list.ts

示例9: sendMessage

	sendMessage(conversationID, message){
		this.call('sendMessage', conversationID, Meteor.userId(), message);
		this.reply = '';
	}
开发者ID:gab3alm,项目名称:lemonaidev3,代码行数:4,代码来源:dynamic-messages.component.ts

示例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) {
开发者ID:kucharskimaciej,项目名称:bullet-journal,代码行数:30,代码来源:posts.ts


注:本文中的meteor/meteor.Meteor.userId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。