當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。