You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 9, 2023. It is now read-only.
When I try to assign this :
new ContactName(null, 'Smith', 'John');
into contact.name :
let contact: Contact = this.contacts.create();
let usuario = new ContactName(null, 'Smith', 'John');
console.log(typeof usuario)
contact.name = new ContactName(null, 'Smith', 'John'); <-- failure occurs here
contact.phoneNumbers = [new ContactField("mobile","6471234567")];
contact.save().then(
() => console.log("Contact saved!", contact),
(error: any) => console.error("Error saving contact.", error)
);
}
I get an error:
ERROR TypeError: Cannot set property 'name' of undefined
at Contact.set [as name] (decorators.js:195)
at HomePage.add (home.ts:85)
at Object.eval [as handleEvent] (HomePage.html:191)
at handleEvent (core.js:13589)
at callWithDebugContext (core.js:15098)
at Object.debugHandleEvent [as handleEvent] (core.js:14685)
at dispatchEvent (core.js:10004)
at core.js:10629
at HTMLButtonElement. (platform-browser.js:2628)
at t.invokeTask (polyfills.js:3)
I im indeed importing :
import { Contacts, Contact, ContactField, ContactName } from '@ionic-native/contacts';
Into the page that I want to use it, and I'm importing the contacts into the constructor.
Also I'm adding into providers the
import { Contacts} from '@ionic-native/contacts';
and I have installed :
$ ionic cordova plugin add cordova-plugin-contacts
$ npm install --save @ionic-native/contacts
The text was updated successfully, but these errors were encountered:
Hi,
When I try to assign this :
new ContactName(null, 'Smith', 'John');
into contact.name :
let contact: Contact = this.contacts.create();
I get an error:
ERROR TypeError: Cannot set property 'name' of undefined
at Contact.set [as name] (decorators.js:195)
at HomePage.add (home.ts:85)
at Object.eval [as handleEvent] (HomePage.html:191)
at handleEvent (core.js:13589)
at callWithDebugContext (core.js:15098)
at Object.debugHandleEvent [as handleEvent] (core.js:14685)
at dispatchEvent (core.js:10004)
at core.js:10629
at HTMLButtonElement. (platform-browser.js:2628)
at t.invokeTask (polyfills.js:3)
I im indeed importing :
import { Contacts, Contact, ContactField, ContactName } from '@ionic-native/contacts';
Into the page that I want to use it, and I'm importing the contacts into the constructor.
Also I'm adding into providers the
import { Contacts} from '@ionic-native/contacts';
and I have installed :
$ ionic cordova plugin add cordova-plugin-contacts
$ npm install --save @ionic-native/contacts
The text was updated successfully, but these errors were encountered: