本文整理汇总了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');
}
}
示例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 = '';
}
示例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);
}
});
});
}
示例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);
}
},
示例7: getUserProfile
public getUserProfile(){
if(this.cur_user){
return this.user.profile;
}
else{
return Meteor.call('getUserProfile',[this.userid]);
}
}
示例8: reject
return new Promise<boolean>( (resolve, reject)=> {
Meteor.call('removeRole', role, (error)=> {
if (error) {
reject(error);
} else {
resolve(true);
}
});
});
示例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!')
}
});
}
示例10: doAddNewItem
doAddNewItem() {
Meteor.call('addItem', this.newItem, function (error, result) {
if (error) {
console.log(error)
} else {
console.log(result)
}
});
}