title: i am trying to send from one controller to other contoller in angularjs but is not working
body: <pre><code>/*service */
   app.service('sharedProperties', function () {
          var property = 'First';
  
          return {
              getProperty: function () {
                  return property;
              },
              setProperty: function(value) {
                  property = value;
              }
          };
      });
  
  
  /*first contoller */
  app.controller('loginCtrl',function($scope,$location,$http,$window,sharedProperties){
      $scope.submit =function(){
          var username=$scope.username;
          var pass=$scope.password;
        sharedProperties.setProperty(username);          
  
  
   $location.path('/userdashboard');
   $window.location.reload();
              });
          }  
      });
  
  /*second controller*/
  app.controller('empController', function($route,$scope,$http,$routeParams,sharedProperties){
  
      $scope.getEmployees = function(){
  
          alert( sharedProperties.getProperty());
  
       };    
     };
  </code></pre>