本文整理汇总了TypeScript中collections/machines.Machines类的典型用法代码示例。如果您正苦于以下问题:TypeScript Machines类的具体用法?TypeScript Machines怎么用?TypeScript Machines使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Machines类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: function
Meteor.publish('machines', function(options: Object, nameQuery: string) {
Counts.publish(this, 'numberOfMachines',
Machines.find(buildQuery.call(this, null, nameQuery)),
{ noReady: true });
return Machines.find(buildQuery.call(this, null, nameQuery), options);
});
示例2: loadMachines
export function loadMachines() {
if (Machines.find().count() !== 0) {
return;
}
var machines = [
{
name: 'ENGEL 10',
pressure: 40,
isOperative: true
},
{
name: 'Brach PX-8',
pressure: 10,
isOperative: true
},
{
name: 'ENGEL 20',
pressure: 45,
isOperative: false
}
];
for (var i = 0; i < machines.length; i++) {
Machines.insert(machines[i]);
}
}
示例3: checkPermissions
function checkPermissions(instruction: ComponentInstruction) {
var machineId = instruction.params['machineId'];
var machine = Machines.findOne(machineId);
return machine && machine.owner == Meteor.userId();
}
示例4:
this.subscribe('machine', machineId, () => {
this.machine = Machines.findOne(machineId);
}, true);