0.0.4 • Published 11 years ago
cordova-contact-adapter v0.0.4
cordova-contact-adapter
An adapter and model for use with cordova contacts plugin
Installation
npm install --save-dev cordova-contact-adapter- or with the latest
ember-cli:ember install:addon cordova-contact-adapter
Using
Simply use the
cordova-contactmodel as you'd simply do with any otherember-datamodel:// file: app/routes/contacts.js import Ember from 'ember'; export default Ember.Route.extend({ model: function () { return this.store.find('cordova-contact'); } });When querying for specific contacts on multiple fields, be sure to use the same filter value for all the query parameters:
this.store.find('cordova-contact', {name: 'huafu', nickname: 'huafu', displayName: 'huafu'});Available fields for searching are the same as
cordova.contacts.fieldType:addressesbirthdaycategoriescountrydepartmentdisplayNameemailsfamilyNameformattedgivenNamehonorificPrefixhonorificSuffixidimslocalitymiddleNamenamenicknamenoteorganizationsphoneNumbersphotospostalCoderegionstreetAddresstitleurls
There are 2 special properties on each model as well as the core ones from cordova contacts plugin:
anyName: to access to the first available name of the contact between all fields from cordovaanyPhotoUrl: to access the first available photo as an URL (normallyfile://)anyPhoneNumber: to access the first available phone numberanyURL: to access the first available URLanyEmail: to access the first available email address
Running Tests
ember testember test --server
For more information on using ember-cli, visit http://www.ember-cli.com/.