Giter VIP home page Giter VIP logo

cordova-contact-adapter's Introduction

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-contact model as you'd simply do with any other ember-data model:

    // 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:

    • addresses
    • birthday
    • categories
    • country
    • department
    • displayName
    • emails
    • familyName
    • formatted
    • givenName
    • honorificPrefix
    • honorificSuffix
    • id
    • ims
    • locality
    • middleName
    • name
    • nickname
    • note
    • organizations
    • phoneNumbers
    • photos
    • postalCode
    • region
    • streetAddress
    • title
    • urls
  • 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 cordova
    • anyPhotoUrl: to access the first available photo as an URL (normally file://)
    • anyPhoneNumber: to access the first available phone number
    • anyURL: to access the first available URL
    • anyEmail: to access the first available email address

Running Tests

  • ember test
  • ember test --server

For more information on using ember-cli, visit http://www.ember-cli.com/.

cordova-contact-adapter's People

Contributors

huafu avatar peteonrails avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.