I would like to display the contact list using the monaca contact plug-in.

Asked 2 years ago, Updated 2 years ago, 53 views

I would like to use the monaca contact plug-in to display the contact list.

app.controller('MainController', function($scope){
     …
      });
      
      ons.ready(function(){
        // contact = new Contact();
        var options = new ContactFindOptions();
        options.filter="";
        options.multiple=true;
        varfields = ["*"];
        contact=navigator.contacts.find(
    ...

App.controller('MainController', function($scope) {
before loading the file defining ContactFindOptions (Cordova)      …
});
If you want to bind the value obtained in ContactFindOptions to the MainController properties, you do not know how to describe it.I'm sorry I'm a beginner.

monaca

2022-09-30 19:00

1 Answers

When cordova is ready, the devicesready event is triggered.

 document.addEventListener("device ready", function(){
  alert('ok');
}, false);

Perhaps you can do this by:

app.controller('MainController', function($scope){

  var options = null;

  document.addEventListener("device ready", function(){
    options = new ContactFindOptions();
  }, false);
});

Am I correct in understanding that AngularJS+cordova works together?
Here may also be helpful.


2022-09-30 19:00

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.