Phonegap-Cordova Selecting Multiple Photos

Page 1

Phonegap / Cordova Selecting Multiple Photos In this document I have explained how to “Phonegap/cordova Selecting Multiple Photos” and also explained code controller , You can easily implement after reading this document. This very useful for developer Cordova camera plugin allow user to select one picture at a time. However, we can show all pictures selected by gallery or captured by camera one by one by following code:

view file: 1. 2.

<div ng-controller=“MultipleSelEx”> <div class="list card">

3. <div class="item item-divider" ngclick="oneImage()">Select one picture</div> 4.

<div class="item item-body"> <div ng-repeat="item in image">

5. 6. width="50" height="50" /> 7.

</div>

<img ng-src="{{item}}" id="myImage"


</div>

8. 9.

</div>

10.

<div class="list card">

11. <div class="item item-divider" ngclick="mulImage()">select multiple pictures</div> <div class="item item-body�>

12.

<div ng-repeat="item in images">

13.

<img ng-src="{{item}}" id="myImage"

14. width="50" height="50" /> </div>

15.

</div>

16. 17.

</div>

18.

</div>

1.

angular.module(‘myApp', ['ngCordova'])

JS file:

2. .controller('MultipleSelEx', function($scope, $rootScope, $cordovaCamera ) { 3.

$scope.image = [];

4.

$scope.oneImage = function() {

5.

var options = {

6.

quality: 50,

7.

destinationType: Camera.DestinationType.FILE_URI,

8.

sourceType: Camera.PictureSourceType.PHOTOLIBRARY,

9.

targetWidth: 200,

10.

targetHeight: 200


};

11.

12. $cordovaCamera.getPicture(options).then(function(imageUri) { $scope.image.push(imageUri);

13. 14.

....

Read Full Blog: Phonegap / Cordova Selecting Multiple Photos

You can check more informative blogs and tutorials at iphone, android development blogs section and can also browse the iOS developer forum , android developer forum for posting and viewing latest questions on iphone development.


Turn static files into dynamic content formats.

Create a flipbook
Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.