Having some trouble saving an array in AngularJS' $cacheFactory. When attempting to retrieve the array, it's coming back as undefined.
Here is the code snippet:
angular.module('cacheExampleApp', []).
controller('CacheController', ['$scope', '$cacheFactory', function($scope, $cacheFactory) {
$scope.myArray = [
"one",
"two",
"three"
];
$scope.keys = [];
$scope.cache = $cacheFactory('cacheId');
$scope.put = function(key, value) {
$scope.cache.put(myArray, $scope.myArray);
$scope.keys.push(key);
};
console.log("Checking myArray:");
console.log($scope.cache.get($scope.myArray));
}]);
...along with a Plunker link.
Any suggestions on what's causing this issue?