ionic-team / ng-cordova

OBSOLETE: Please move to Ionic Native https://github.com/ionic-team/ionic-native
https://github.com/ionic-team/ionic-native
MIT License
3.48k stars 1.05k forks source link

Contact widget issue #1035

Open myfreax opened 9 years ago

myfreax commented 9 years ago
  $scope.getAllContacts = function() {
    $cordovaContacts.find().then(function(allContacts) { //omitting parameter to .find() causes all contacts to be returned
      $scope.contacts = allContacts;
    }
  };
error
TypeError: Cannot read property 'fields' of undefined
correct
$cordovaContacts.find("*").then(function(allContacts) {
                    //omitting parameter to .find() causes all contacts to be returned
                    $scope.contacts = allContacts;
                });
javalight commented 9 years ago

The correction does not work for me i get error:

Uncaught TypeError: Object.keys called on non-object 

Correct add empty array:

$cordovaContacts.find([]).then(function(allContacts) {
                    $scope.contacts = allContacts;
                });
lawsonk1215 commented 9 years ago

Different for me. Correct way was an empty object.

    $cordovaContacts.find({}).then(function(allContacts) {
                    $scope.contacts = allContacts;
                });
myfreax commented 8 years ago

@javalight thank you,I solved it!

hudsonpereira commented 8 years ago

@javalight yeah, thanks. I was stuck for hours. Apparently no site shows it that way.

👍

MdShuaib commented 7 years ago

@javalight Thank you so much!!

newsof1111 commented 7 years ago

your plugin is not installed correctly