title: AngularJs: Controllers calls service method
body: <p>I tried to create a method in the services.js :</p>
  
  <p>var esServices= angular.module('esServices', []);</p>
  
  <pre><code>esServices.factory('boxItems', ['$http', function($http) {
                ................
            }]); 
  
  esServices.factory('cartItems', ['$cookieStore', function($cookieStore) {
          array = $cookieStore.get('key');
          var cartItems = new function(){},           
          cartItems.addItem = function(itemSelected){     
          $cookieStore.put('key', []);        
      array.push(itemSelected);
     $cookieStore.put('key', array);   
                  }
        }]);
  </code></pre>
  
  <p>in my controllers I call the service method:</p>
  
  <pre><code>         esControllers.controller('esList', ['$scope','cartItems','$cookieStore',
                      function($scope,cartItems,$cookieStore) {          
                cartItems.addItem($scope.element,function(){});
       };
    }]);
  
  (itemSelected is an object) 
  </code></pre>
  
  <p>Do you Know if it is possible to pass values (objects) from Controller to Service Method in this way?</p>
  
  <p>Somebody can help me!!!</p>