Hello everyone,
i have a problem in plugin contacts :
--------> app.js
$ionicPlatform.ready(function() {
$scope.getAllContacts = function() {
var opts = {
filter : ‘’,
multiple : true,
fields : [‘displayName’]
};
if (ionic.Platform.isAndroid()) {
opts.hasPhoneNumber = true;
}
console.log($cordovaContacts); /* RESULT :
Object {
clone: function(e)
find: function(n)
pickContact: function()
remove: function(n)
save: function(n)
proto: Object
}
*/
$cordovaContacts.find(opts).then(function (contactsFound) { // Uncaught TypeError: Cannot read property ‘find’ of undefined
$scope.contacts = contactsFound;
console.log(JSON.stringify(contactsFound));
});
});
--------> index.html
- < script src=“js/ng-cordova.min.js”>
- < ion-item ng-repeat=“con in contacts”>
{{con.displayName}}
someone help me please