Hi guys,

I am new to angularjs. I would like to implement a mobile app which take 
picture, crop it then send it to WCF service. I got a sample but don't know 
how to make it work. I tried like this but content didn't show up. How to 
make it work?

Here is my sample html:

<ion-content ng-controller="ImageController" padding="true"> <button 
class="button button-full button-assertive" ng-click="addImage()"> Take 
Photo </button> </ion-content>

And here is portion of  the app.js:

var batchModule = angular.module('starter', ['ionic', 'ngCordova']) var 
ImageController = function ($scope, $q, ImageService, FileManager) { 
function addImage() { var type = 1; // 1 = camera, 2 = photo library var 
fileName = 'image -' + Date.now() + '.jpg'; // Set image options (quality, 
height/width) var imageOpts = getImageOpts(type); var targetDir = 
cordova.file.dataDirectory + '/LottoPictures'; // target directory on the 
native file system var fileUrl = null; // file URL on the native file 
system // // Now execute all the steps of the "pipeline" via Promise 
chaining: // ImageService.getPicture(type, imageOpts.pictureQuality, 
imageOpts.targetSize).then(function (imageUrl) { 
$log.debug("ImageService#getPicture imageUrl = '" + imageUrl + "'"); return 
FileManager.downloadFile(imageUrl, targetDir, 'uncropped-' + fileName); 
}).then(function (result) { $log.debug("FileManager#downloadFile uncropped 
result = " + JSON.stringify(result)); fileUrl = result.nativeURL; // image 
file downloaded to the native file system, clean up the temp files 
ImageService.cleanup(); }).then(function (ignore) { $log.debug("Done"); 
}).catch(function (error) { $log.debug("Error in addImage: " + 
JSON.stringify(error)); }); } }; 


-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to