Hi,
I’m using ionic 2
here’s my code:
import { Contacts, ContactFindOptions } from ‘@ionic-native/contacts’;
import { CallNumber } from ‘@ionic-native/call-number’;
@Component({
selector: ‘page-home’,
templateUrl: ‘home.html’,
providers: [Contacts]
})
export class HomePage {
items: any[];
itemsAll: any[];
constructor(public navCtrl: NavController,private contacts: Contacts,private event: Events, private callNumber: CallNumber) {
this.initializeItems();
}
initializeItems() { this.items = [];
const options = new ContactFindOptions();
options.filter = ""
options.multiple = true;
options.hasPhoneNumber = true;
this.contacts.find([’*’], options)
.then(data => {
this.items = data;
this.itemsAll = data;
});
removeContact(item){
this.contacts.removeContact(); // error here
}
}
How can I handle this error?
Thanks