【发布时间】:2014-03-29 16:40:57
【问题描述】:
我正在使用monaca ide开发一个简单的应用程序,并使用onsenui的slinding menu我发现通常在我拍照时重新加载页面,所以照片不会出现在页面上。似乎是随机的,有时会发生有时不会,我可以找到原因。有什么想法吗?
更新:
在这里你可以看到action所在的控制器:
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);
}
}
])
【问题讨论】:
标签: javascript onsen-ui monaca