AngularJS cacheFactory not working -


this code:

app.directive('topnav', function(api, $cachefactory) {     return {         scope: {},         restrict: 'e',         templateurl: 'packages/partials/includes/header.html',         link: function($scope) {             var cache = $cachefactory('datacache');              if( cache !== undefined ) {                 api.data().success(function(data){                     $scope.phone = data.phone;                     $scope.mail = data.email;                     cache.put('data', data);                  });             } else {                 $scope.phone = cache.get('data').phone;                 $scope.mail = cache.get('data').email;                 console.log(cache.get('data'));             }         }     }; }); 

the problem returns undefined , don't know what's going wrong, may go wrong ?


Comments

Popular posts from this blog

c# - Better 64-bit byte array hash -

webrtc - Which ICE candidate am I using and why? -

php - Zend Framework / Skeleton-Application / Composer install issue -