How to delete contact using cordova-plugin-contacts


#1

I have to delete contact using cordova-plugin-contacts but i can’t find remove method of contacts plugin

I have checked http://ionicframework.com/docs/v2/native/contacts/
and also https://github.com/apache/cordova-plugin-contacts

Please help


#2

All the same… It was a month before, please reply to us


#3
    this.contactsCtrl.find(['displayName'], {filter: "Bob"}).then((contact) => {

        console.log("DEBUG: Contact to be deleted = " + JSON.stringify(contact[0]))

        contact[0].remove();

    });

Method exists, otherwise it is called “remove()” and it’s a child of the “Contact” type, not the “Contacts” controller itself. So you have to get the Contact element, for example with Contacts.find() and then call .remove() on it :smiley: