title: using cookies in angularjs 1.4.2
body: <p>I'm doing a simple "add to cart" system. I want the items in my basket to not disappear so I'm trying to use angularjs cookies. It works without adding cookie item, adding and removing ok.</p>
  
  <pre><code>var app = angular.module('myApp', ['ui.bootstrap','ngCookies']);
  app.controller('menusCtrl', ['$cookies',function($scope, $http,$cookies) {
     $http.get("getContent.php").success(function (response) {$scope.items = response.menus;});
     $scope.basketlist = [];
     $scope.updateCart = function (index) {
      var item = $scope.items[index];
      $scope.basketlist.push({quantity: 1, price: item.menu_price,no:item.menu_no,image:item.menu_img});
      $cookies.put("basketlist",$scope.basketlist);
     }
      $scope.remove = function(index) {
        var itemtodelete = $scope.basketlist.indexOf(index);
          $scope.basketlist.splice(index, 1);
      }
  }]);
  </code></pre>
  
  <p>I insert /angularjs/1.4.2/ and /1.4.2/angular-cookies.js</p>
  
  <p>I got these errors:</p>
  
  <pre><code>TypeError: Cannot read property 'get' of undefined
  at new &lt;anonymous&gt; (app.js:4)
  at Object.e [as invoke] (angular.js:4452)
  at $get.P.instance (angular.js:9001)
  at S (angular.js:8111)
  at g (angular.js:7543)
  at g (angular.js:7547)
  at angular.js:7418
  at angular.js:1635
  at n.$get.n.$eval (angular.js:15848)
  at n.$get.n.$apply (angular.js:15947)(anonymous function) @ angular.js:12332$get @ angular.js:9111$get.n.$apply @ angular.js:15949(anonymous function) @ angular.js:1633e @ angular.js:4452d @ angular.js:1631Ac @ angular.js:1651Zd @ angular.js:1545(anonymous function) @ angular.js:28361m.Callbacks.j @ jquery.js:3148m.Callbacks.k.fireWith @ jquery.js:3260m.extend.ready @ jquery.js:3472J @ jquery.js:3503
  </code></pre>