Details Link: http://www.ncloud.hk/%E6%8A%80%E6%9C%AF%E5%88%86%E4%BA%AB/cordova-3-cordovaimagepicker/
This is to be able to choose more than one image from the phone plug-in, is at that time in the camera, upload pictures related functions in the Ngcordova official website to see, the following brief introduction of its use:
1, first need to have a simple project, and then enter the command line to add plug-in commands:
Cordova Plugin Add Https://github.com/wymsee/cordova-imagePicker.git
2, in the HTML code below, to invoke the corresponding controller function to use the plug-in, I would like to write a simple:
<div ng-repeat= "item in ALLIMG" >
/>
<div>
3, in the JS code as follows, this code is written in the corresponding controller and rely on ' $cordovaImagePicker ', remember in app.js rely on ' Ngcordova ', this is Ngcordova official website controller inside the code,:
var options = {
Maximumimagescount:10,//number of pictures to be displayed
width:800,
height:800,
Quality:80
};
$scope. getimages = function () {
$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
});
}
This way you can choose more photos, but this plugin after the selection of photos of the data is not Base64 format, no way to upload to our server, so later abandoned this method, later can be studied
This article is from the "11141997" blog, please be sure to keep this source http://11151997.blog.51cto.com/11141997/1745426
Cordova Introduction series of various plug-ins (iii)-$cordovaImagePicker Select multiple images from your phone's gallery