i am creating android application using ionic and angularjs and using window.requestFileSystem for get image from storage. So for this process i used $q.defer() for asynchronous process and its working fine and showing object in console: console.log(deferred.promise)
but now, when i am trying to get the value from deferred.promise like
var vals = deferred.promise;
console.log(vals.$$state.value);
its showing undefined. Can anyone tell me how i can get that value?
My Code:
var deferred = $q.defer();
document.addEventListener("deviceready", function() {
window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, function (fileSystem) {
imagePath = fileSystem.root.toURL() + 'SmaartMedia/' + splited[splitedLength-1];
deferred.resolve(imagePath);
$rootScope.$apply();
});
}, false);
var vals = deferred.promise;
console.log(vals.$$state.value);
Thanks
