本文整理汇总了TypeScript中collections/parties.Parties类的典型用法代码示例。如果您正苦于以下问题:TypeScript Parties类的具体用法?TypeScript Parties怎么用?TypeScript Parties使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Parties类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: loadParties
export function loadParties() {
if (Parties.find().count() === 0) {
var parties = [
{
'name': 'Dubstep-Free Zone',
'description': 'Can we please just for an evening not listen to dubstep.',
'location': 'Palo Alto'
},
{
'name': 'All dubstep all the time',
'description': 'Get it on!',
'location': 'Palo Alto'
},
{
'name': 'Savage lounging',
'description': 'Leisure suit required. And only fiercest manners.',
'location': 'San Francisco'
}
];
for (var i = 0; i < parties.length; i++) {
Parties.insert(parties[i]);
}
}
};
开发者ID:alexisllamas,项目名称:Socialist,代码行数:26,代码来源:load-parties.ts
示例2: loadParties
export function loadParties() {
if (Parties.find().count() === 0) {
var parties = [
{
'name': 'Dubstep-Free Zone',
'description': 'Can we please just for an evening not listen to dubstep.',
'location': {
name: 'Palo Alto'
},
'public': true
},
{
'name': 'All dubstep all the time',
'description': 'Get it on!',
'location': {
name: 'Palo Alto'
},
'public': true
},
{
'name': 'Savage lounging',
'description': 'Leisure suit required. And only fiercest manners.',
'location': {
name : 'San Francisco'
},
'public': false
}
];
for (var i = 0; i < parties.length; i++) {
Parties.insert(parties[i]);
}
Accounts.createUser({
username: 'admin',
email: '[email protected]',
password: 'party'
});
Accounts.createUser({
username: 'user',
email: '[email protected]',
password: 'party'
});
}
};
开发者ID:fishdude,项目名称:ionic2-meteor,代码行数:47,代码来源:load-parties.ts
示例3: saveParty
saveParty(party: Party) {
Parties.update(party._id, {
$set: {
name: party.name,
description: party.description,
location: party.location
}
});
}
开发者ID:googelybear,项目名称:meteor-socially,代码行数:9,代码来源:party-details.ts
示例4: saveParty
saveParty(party: Party) {
if (Meteor.userId()) {
Parties.update(party._id, {
$set: {
name: party.name,
description: party.description,
location: party.location
}
});
} else {
alert('Please log in to change this party');
}
}
开发者ID:MaartenMcFly,项目名称:angular2-meteor,代码行数:13,代码来源:party-details.ts
示例5: function
Meteor.publish('uninvited', function(partyId: string) {
let party = Parties.findOne(partyId);
if (!party)
throw new Meteor.Error('404', 'No such party!');
return Meteor.users.find({
_id: {
$nin: party.invited || [],
$ne: this.userId
}
});
});
开发者ID:fishdude,项目名称:ionic2-meteor,代码行数:13,代码来源:users.ts
示例6: loadTestData
export function loadTestData() {
if (Parties.find().count() === 0) {
var parties = [{
'name': 'Dubstep-Free Zone',
'location': 'Mountain View',
'description': 'Can we please just for an evening not listen to dubstep.'
}, {
'name': 'All dubstep all the time',
'location': 'Mountain View',
'description': 'Get it on!'
}, {
'name': 'Savage lounging',
'location': 'Palo Alto',
'description': 'Leisure suit required. And only fiercest manners.'
}];
for (var i = 0; i < parties.length; i++) {
Parties.insert(parties[i]);
}
var locations = ['Mountain View', 'Palo Alto'];
for (var i = 0; i < 1000; i++) {
var location = locations[(Math.random() * 2) >> 0];
Parties.insert({
name: Fake.sentence(50),
location: location,
description: Fake.sentence(100)
});
}
Accounts.createUser({
username: 'party',
email: '[email protected]',
password: 'admin'
});
}
}
开发者ID:fuzolan,项目名称:angular2-meteor-client,代码行数:37,代码来源:test_data.ts
示例7: function
Meteor.publish('parties', function(options: Object, location: string) {
Counts.publish(this, 'numberOfParties',
Parties.find(buildQuery.call(this, null, location)), { noReady: true });
return Parties.find(buildQuery.call(this, null, location), options);
});
开发者ID:fishdude,项目名称:ionic2-meteor,代码行数:5,代码来源:parties.ts
示例8:
this.subscribe('party', partyId, () => {
this.party = Parties.findOne(partyId);
}, true);
开发者ID:fuzolan,项目名称:angular2-meteor-client,代码行数:3,代码来源:party-details.ts
示例9: removeParty
removeParty(party) {
Parties.remove(party._id);
}
开发者ID:alexisllamas,项目名称:Socialist,代码行数:3,代码来源:app.ts
示例10: constructor
constructor () {
this.parties = Parties.find();
}
开发者ID:alexisllamas,项目名称:Socialist,代码行数:3,代码来源:app.ts
注:本文中的collections/parties.Parties类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论