angularjs - locaforage getItem() is not executing -


$localforage.getitem('brandchainnames', function(err, data) {     // same code, using es6 promises.     console.log('_storedvalue: '+ data); }); 

there no key far (verified in tools-> storage perspective). console output not print (in firefox). tell me problem. console output before , after it, prints fine.

edit: modified code like:

var hallabolo = $localforage.getitem('brandchainnames', function(err, data) {     // same code, using es6 promises.     console.log('_storedvalue: '+ data); }); 

angular.tojson(hallabolo) prints {}
tried with:
1.json.stringify(hallabolo)=='{}'// returns false
2.object.keys(hallabolo).length // returns 1
3. jquery.isemptyobject(hallabolo)// returns false
4. angular.isobject(hallabolo)// returns true

not mention type of 'undefined', null etc not work hallabolo object

$localforage.getitem('brandchainnames', function(err, data) {     // same code, using es6 promises.     console.log('_storedvalue: '+ data); }); 

is not working following working:

$localforage.getitem('brandchainnames').then(function(data) {     // same code, using es6 promises.     console.log('_storedvalue: '+ data);// data printed undefined, expected }); 

anyone, why?


Comments

Popular posts from this blog

google chrome - Developer tools - How to inspect the elements which are added momentarily (by JQuery)? -

angularjs - Showing an empty as first option in select tag -

php - Cloud9 cloud IDE and CakePHP -