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


TypeScript parties.Parties類代碼示例

本文整理匯總了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: 'admin@socially.com',
      password: 'party'
    });

    Accounts.createUser({
      username: 'user',
      email: 'user@socially.com',
      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('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

示例6: 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

示例7: 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: 'admin@socially.com',
      password: 'admin'
    });
  }
}
開發者ID:fuzolan,項目名稱:angular2-meteor-client,代碼行數:37,代碼來源:test_data.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;未經允許,請勿轉載。