I am storing data to $cacheFactory as such:
$scope.loginCache = $cacheFactory.get('login') || $cacheFactory('login') ;
$scope.loginCache.put("smsData",$scope.smsData) ;
And later am retrieving it with:
$scope.loginCache = $cacheFactory.get('login') || $cacheFactory('login') ;
$scope.smsData = $scope.loginCache.get('smsData') ;
However, I am unable to access the various elements of $scope.smsData. Out putting it to console.log does show all the values there but for some reason I am unable to access the data - what am I doing wrong?
console.log($scope.smsData) ; // displays full object
console.log($scope.smsData.value) ; // `undefined`
console.log($scope.smsData[0]) ; // `undefined`
console.log($scope.smsData.value[0]) ; // `undefined`
console.log($scope.smsData) outputs:
Promise {$$state: {…}}
$$state:
status:1
value:Array(2)
0:{table: "smsSent", data: {…}}
1:{apiStatus: true}
Ultimately, I am trying to retrieve: value[0].data
$scope.smsData.then(function(res){console.log(res.value)})