前端 - ionic cordovaImagePicker 使用

浏览:46日期:2023-01-22

问题描述

Cannot read property ’getPictures’ of undefined at Object.getPictures

.controller(’AccountCtrl’, function($scope,$cordovaImagePicker,$ionicActionSheet,$cordovaCamera) { $scope.image_list = []; $scope.addAttachment = function() { nonePopover(); $ionicActionSheet.show({ buttons: [ { text: ’相机’ }, { text: ’图库’ } ], cancelText: ’关闭’, cancel: function() { return true; }, buttonClicked: function(index) { switch (index){case 0:appendByCamera(); break;case 1:pickImage();// <span style='color:#ff0000;'>pickImage();</span> break;default: break; } return true; } }); } var pickImage = function () { var options = {maximumImagesCount: 1,width: 800,height: 800,quality: 80 };$cordovaImagePicker.getPictures(options).then(function (results) { $scope.images_list.push(results[0]); }, function (error) { // error getting photos}); } });

问题解答

回答1:

可能是因为你没有安装ImagePicker插件

相关文章: