离子:ngCordova 没有响应:无法读取未定义的 属性 'file'

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

我正在尝试加载 cordova-plugin-file(来自 ngCordova)。 this doc 全部完成。这是我的代码:

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

(有无"window."都一样) 这是结果:

Cannot read property 'file' of undefined

所以我终于找到了答案:ngCordova 无法在浏览器中正常 运行。我将 Ripple 模拟器(Chrome 扩展名)用于 运行 我的应用程序并查看了日志。实际上,日志告诉我我的代码是正确的。