當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript Meteor.call方法代碼示例

本文整理匯總了TypeScript中meteor/meteor.Meteor.call方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript Meteor.call方法的具體用法?TypeScript Meteor.call怎麽用?TypeScript Meteor.call使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在meteor/meteor.Meteor的用法示例。


在下文中一共展示了Meteor.call方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: proposeSharedSession

var proposeSharedSession = function proposeSharedSession(partnerId) {
  Meteor.call('updateSharingState', {
    userId: Meteor.user()._id,
    sharingStatus: SharedState.PROPOSING,
    partnerId: partnerId
  });
  Meteor.call('updateSharingState', {
    userId: partnerId,
    sharingStatus: SharedState.PROPOSED_TO,
    partnerId: Meteor.user()._id
  });
};
開發者ID:fullflavedave,項目名稱:meteor-paraviewweb-blaze-ui,代碼行數:12,代碼來源:paraview_shared_session_controls.ts

示例2: completeTask

completeTask(task){
  console.log('Task Completed in Service');
  console.log(task);
    if (Meteor.userId()) {
      if(task.status!='COMPLETED')
      Meteor.call('tasks.setStatus', task._id,'COMPLETED');
      else
      Meteor.call('tasks.setStatus', task._id,'ACTIVE');
      //update observable
    // this._taskObserver.next(Tasks.find().fetch());
    } else {
      alert('Please log in to add a task');
    }

}
開發者ID:LIOSK-ORG,項目名稱:todo-app,代碼行數:15,代碼來源:TaskService.ts

示例3: sendComment

  sendComment(c) {

    let name = Meteor.users.findOne(Meteor.userId()).profile.name;

    this.comments.push({
      idUser: Meteor.userId(),
      name: name,
      comment: c
    });

    Posts.update(
      {
        _id: this.idPost
      }, {
        $set: {
          comments: this.comments
        }
      }
    );

    Meteor.call('simpanTimeLine', {
      dateTime: new Date(),
      status: 'comment',
      message: `${name} commented on ${this.nameUserPost}'s post`
    }, (error) => {
      if (error) {
        console.log(error);
      }
    });

    this.inputComment = '';
  }
開發者ID:RizkiMufrizal,項目名稱:Socially-Angular2-Meteor,代碼行數:32,代碼來源:post-component.ts

示例4: sendPost

  sendPost(p) {
    let name = Meteor.users.findOne(Meteor.userId()).profile.name;
    Meteor.call('simpanPost', {
      idUser: Meteor.userId(),
      name: name,
      status: p,
      dateTime: new Date(),
      comments: [],
      likes: []
    }, (error) => {
      if (error) {
        console.log(error);
      }
      this.inputPost = '';

      Meteor.call('simpanTimeLine', {
        dateTime: new Date(),
        status: 'post',
        message: `${name} send post '${p}'`
      }, (error) => {
        if (error) {
          console.log(error);
        }
      });
    });
  }
開發者ID:RizkiMufrizal,項目名稱:Socially-Angular2-Meteor,代碼行數:26,代碼來源:post-component.ts

示例5: initializeSharingState

const initializeSharingState = function initializeSharingState(userId: string) {
  Meteor.call('updateSharingState', {
    userId: userId,
    sharingStatus: SharedState.INITIALIZED,
    partnerId: null
  });
};
開發者ID:fullflavedave,項目名稱:meteor-paraviewweb-blaze-ui,代碼行數:7,代碼來源:paraview_shared_session_controls.ts

示例6:

 'budget.move-to-top': (category: Category, superCategory: SuperCategory) => {
     const firstNewSiblingCategory = CategoryCollection.findOne({superCategoryId: superCategory._id}, {sort: {budgetSortIndex: 1}});
     if (firstNewSiblingCategory == null) {
         return CategoryCollection.update(category._id, {$set: {superCategoryId: superCategory._id, budgetSortIndex: 0}});
     } else {
         return Meteor.call('budget.move-category', category, firstNewSiblingCategory);
     }
 },
開發者ID:,項目名稱:,代碼行數:8,代碼來源:

示例7: getUserProfile

 public getUserProfile(){
   if(this.cur_user){
     return this.user.profile;
   }
   else{
     return Meteor.call('getUserProfile',[this.userid]);
   }
 }
開發者ID:cemersoz,項目名稱:tuxlab-app,代碼行數:8,代碼來源:account.ts

示例8: reject

 return new Promise<boolean>( (resolve, reject)=> {
   Meteor.call('removeRole', role, (error)=> {
     if (error) {
       reject(error);
     } else {
       resolve(true);
     }
   });
 });
開發者ID:kokokenada,項目名稱:for-real-cards,代碼行數:9,代碼來源:accounts-admin.service.ts

示例9: answer

 answer(answer) {
   Meteor.call('rsvp', this.party._id, answer, (error) => {
     if (error) {
       console.error('Oops, unable to rsvp!');
     } else {
       console.log('RSVP done!')
     }
   });
 }
開發者ID:cloudzombie,項目名稱:meteor-angular-socially,代碼行數:9,代碼來源:partyRsvp.ts

示例10: doAddNewItem

 doAddNewItem() {
     Meteor.call('addItem', this.newItem, function (error, result) {
         if (error) {
             console.log(error)
         } else {
             console.log(result)
         }
     });
 }
開發者ID:aaronksaunders,項目名稱:angular2-meteor-demo,代碼行數:9,代碼來源:addItem.ts


注:本文中的meteor/meteor.Meteor.call方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。