当前位置: 首页>>代码示例>>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;未经允许,请勿转载。