0
我正在嘗試使用$ cordovaImagePicker來集成圖像預覽和上傳功能。但是當我試圖使用
$cordovaImagePicker.getPictures(options)
.then(function (results) {
for (var i = 0; i < results.length; i++) {
console.log('Image URI: ' + results[i]);
}
}, function (error) {
// error getting photos
});
在我的控制器它給我這個錯誤。
Error: n.imagePicker is undefined
[email protected]://localhost/myApp/www/js/ng-cordova.min.js:8:15339
@http://localhost/myApp/www/js/controllers.js:468:13
[email protected]://localhost/myApp/www/lib/ionic/js/ionic.bundle.js:12877:14 [email protected]://localhost/myApp/www/lib/ionic/js/ionic.bundle.js:12885:27
$ControllerProvider/this.$get</<@http://localhost/myApp/www/lib/ionic/js/ionic.bundle.js:17154:18
[email protected]://localhost/myApp/www/lib/ionic/js/ionic.bundle.js:48176:24
ionicViewSwitcher.create/[email protected]://localhost/myApp/www/lib/ionic/js/ionic.bundle.js:46392:29
ionicViewSwitcher.create/[email protected]://localhost/myApp/www/lib/ionic/js/ionic.bundle.js:46312:11
[email protected]://localhost/myApp/www/lib/ionic/js/ionic.bundle.js:48050:5
[email protected]://localhost/myApp/www/lib/ionic/js/ionic.bundle.js:48008:5
[email protected]://localhost/myApp/www/lib/ionic/js/ionic.bundle.js:53315:11
.compile/</<@http://localhost/myApp/www/lib/ionic/js/ionic.bundle.js:53292:11
$RootScopeProvider/this.$get</[email protected]://localhost/myApp/www/lib/ionic/js/ionic.bundle.js:23412:15
transitionTo/$state.transition<@http://localhost/myApp/www/lib/ionic/js/ionic.bundle.js:40882:11
[email protected]://localhost/myApp/www/lib/ionic/js/ionic.bundle.js:21881:27
scheduleProcessQueue/<@http://localhost/myApp/www/lib/ionic/js/ionic.bundle.js:21897:27
$RootScopeProvider/this.$get</[email protected]://localhost/myApp/www/lib/ionic/js/ionic.bundle.js:23093:16
$RootScopeProvider/this.$get</[email protected]://localhost/myApp/www/lib/ionic/js/ionic.bundle.js:22909:15
$RootScopeProvider/this.$get</[email protected]://localhost/myApp/www/lib/ionic/js/ionic.bundle.js:23198:13
[email protected]://localhost/myApp/www/lib/ionic/js/ionic.bundle.js:18351:36
[email protected]://localhost/myApp/www/lib/ionic/js/ionic.bundle.js:18541:7
[email protected]://localhost/myApp/www/lib/ionic/js/ionic.bundle.js:18482:1
我很高興我找到了這個解決方案,因爲我拉着頭髮爲什麼它不起作用。 – Sam
這對我不起作用 –