我正在使用monaca ide开发一个简单的应用程序,并使用onsenui的slinding menu我发现通常当我拍照时重新加载页面,所以照片不会出现在页面上。似乎是随机的,有时会发生有时不会,我可以找到原因。任何想法?
更新:
在这里,您可以看到处理操作的控制器:
var appControllers = angular.module('appControllers', []);
appControllers
.controller('parkingCtrl', [
'$scope',
'appGlobals',
function($scope, appGlobals) {
$scope.snapPhoto = function() {
navigator.camera.getPicture (onSuccess, onFail, {
quality: 50,
destinationType: Camera.DestinationType.FILE_URI,
targetWidth: 100
});
//A callback function when snapping picture is success.
function onSuccess (imageURI) {
$scope.$apply(function(){
$scope.imageURI = imageURI;
});
}
//A callback function when snapping picture is fail.
function onFail (message) {
alert ('Error occured: ' + message);
}
}
])