$scope.takePicture = function() {
var options = {
quality : 75,
destinationType : Camera.DestinationType.DATA_URL,
sourceType : Camera.PictureSourceType.CAMERA,
allowEdit : true,
encodingType: Camera.EncodingType.JPEG,
targetWidth: 300,
targetHeight: 300,
popoverOptions: CameraPopoverOptions,
saveToPhotoAlbum: false
};
$cordovaCamera.getPicture(options).then(function(imageData) {
$scope.imgURI = "data:image/jpeg;base64," + imageData;
}, function(err) {
// An error occured. Show a message to the user
});
}
<div class="list card">
<div class="item item-divider">Picture</div>
<div class="item item-body">
<div>
<ion-content ng-controller="DashCtrl">
<img ng-show="imgURI !== undefined" ng-src="{{imgURI}}">
<img ng-show="imgURI === undefined" ng-src="http://placehold.it/300x300">
<button class="button" ng-click="takePicture()">Take Picture</button>
</ion-content>
</div>
</div>
</div>
i enjoyed seeing core members engaged with this last night. intellectual generosity is a great thing!
@Mark_Zifchock thanks very much for Ionic.js orientation last night. I thought it was really great! Looking forward to a follow up orientation to Angular.js!
Indeed, thanks Mark!
What a great meet-up. I know I got a lot out of it. Also looking forward to the next event.
Interested in:
-Angular.js
-other app-development frameworks?
-Data-driven apps - finding/wrangling/handling data -> output
Can share:
-Noobish questions
-Stuff we already learned in Ionic 101
-Promotion/wrangle more noobs
Jen c posted an awesome list of web stuff…
Oh right, I thought I was over there.
Hey codeschool has a free online course intro to AngularJS: http://campus.codeschool.com/courses/shaping-up-with-angular-js/
I’m going through it now, I like it so far.