@Keertesh wrote:
Continuing the discussion from Cordova Camera Plugin Not Working w/ AngularJS:
I'm using VS 2015 so i installed the plugin directly within the IDE in config.xml
I'm new to angular.
services.js.factory('Camera', function ($q) { return { getPicture: function (options) { var q = $q.defer(); navigator.camera.getPicture(function (result) { q.resolve(result); }, function (err) { q.reject(err); }, options); return q.promise; } } })
controller.js
$scope.takePicture = function (options) { var options = { quality: 75, targetWidth: 200, targetHeight: 200, sourceType: 1 }; Camera.getPicture(options).then(function (imageData) { $scope.picture = imageData; }, function (err) { console.log(err); }); };
myPage.html
<a class="button button-full ion-ios-camera button-outline button-royal" ng-click="takePicture()" > </a>
Posts: 11
Participants: 2