【发布时间】:2015-02-12 12:45:54
【问题描述】:
通过以下方式安装了cordova设备插件:
sudo cordova plugin add org.apache.cordova.device
然后下载 ngCordova 并将 ng-cordova.min.js 包含在 js 文件夹中,也包含在 index.html 中
接下来我做了如下注入ngCordova
angular.module('starter', ['ionic', 'starter.controllers','ngCordova'])
然后按如下方式包含在控制器中
angular.module('starter.controllers', [])
.controller('AppCtrl', function($scope, $ionicModal, $timeout, $ionicPlatform,$cordovaDevice)
but still getting the following errors
ReferenceError: device is not defined
at Object.getUUID (http://localhost:8100/js/ng-cordova.min.js:1:14929)
at new <anonymous> (http://localhost:8100/js/controllers.js:27:26)
at invoke (http://localhost:8100/lib/ionic/js/ionic.bundle.js:11591:17)
at Object.instantiate (http://localhost:8100/lib/ionic/js/ionic.bundle.js:11602:23)
at http://localhost:8100/lib/ionic/js/ionic.bundle.js:14906:28
at updateView (http://localhost:8100/lib/ionic/js/ionic.bundle.js:42986:30)
at eventHook (http://localhost:8100/lib/ionic/js/ionic.bundle.js:42933:17)
at Scope.$broadcast (http://localhost:8100/lib/ionic/js/ionic.bundle.js:20605:28)
at $state.transition.resolved.then.$state.transition (http://localhost:8100/lib/ionic/js/ionic.bundle.js:34122:22)
at wrappedCallback (http://localhost:8100/lib/ionic/js/ionic.bundle.js:19197:81)
你现在能告诉我出了什么问题吗?
如果有其他方法可以读取设备 UUID,请告诉我它的方向。
【问题讨论】:
标签: android angularjs cordova ionic-framework ionic