I am trying to add a cookie using $ cookieStore
$scope.addSession = function() { console.log('adding session'); $cookieStore.put('session', 'value'); $scope.session= $cookieStore.get('session'); };
But it does not work with the following error
Error: Can't find variable: $cooki addSession@http ://run.plnkr.co/61uMvzWlbCCsHRYM/script.js:8 @https://ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.js:6365 @https://ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.js:12987 $eval@https ://ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.js:8057 $apply@https ://ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.js:8137 @https://ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.js:12988 dispatch@http ://code.jquery.com/jquery-2.0.3.min.js:5 handle@http ://code.jquery.com/jquery-2.0.3.min.js:5 [native code]
Demo / code can be found here.
Please let me know what I'm doing wrong here.
source share