Search code examples
cordovaionic-frameworkcordova-pluginsngcordova

Ionic : ngCordova not responding : Cannot read property 'file' of undefined


I'm trying to load cordova-plugin-file (from ngCordova). All of this doc has been done. Here is my code :

.run(function($ionicPlatform, $cordovaFile) {
  $ionicPlatform.ready(function() {
      console.log(window.cordova.file);
  }
}

(the same with or without "window.") and here is the result :

Cannot read property 'file' of undefined


Solution

  • So I finally found the answer : ngCordova cannot run properly in the browser. I used Ripple emulator (Chrome extension) to run my app and see the logs. And actually the logs told me that my code was right.