Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var contacts = [<contact-number-1>, <contact-number-2>, <contact-number-3>];
- var promises = _.times(2, function (index) {
- console.log('Finding contact: ' + contacts[index]);
- return $cordovaContacts
- .find({
- multiple: true,
- desiredFields: ['name', 'phoneNumbers'],
- filter: contacts[index],
- fields: ['phoneNumbers']
- })
- .then(function (c) {
- console.log('contact');
- console.log(c);
- return c;
- })
- .catch(function(error) {
- console.log(error);
- });
- });
- console.log('promises.length: ' + promises.length);
- $q.all(promises).then(function(results) {
- console.log('results');
- console.log(results);
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement