title: Service is not working?
body: <p>So Here is a thing i want to pass Selected option from select list from one jsp page to another page using different controllers.</p>
  
  <p>But i guess its not working and i dont want to use views or ngRoute</p>
  
  <p>fileList.jsp</p>
  
  <pre><code>  &lt;div ng-controller="fileController"&gt;
                      &lt;form name="selectFile" class="form-horizontal" role="form"&gt;
                          &lt;div class="row"&gt;
                              &lt;div class="col-sm-2 col-md-offset-2"&gt;
                                  &lt;h4&gt;Select a File&lt;h4&gt;
                              &lt;/div&gt;
                              &lt;div class="col-sm-3 col-md-offset-0"&gt;
                                  &lt;div class="form-group" &gt;
                                      &lt;select name="carrier_id" ng-model="selectedFile.serviceFile" ng-options="file[0] as file[1] for file in fileList" class="form-control"&gt;
                                       &lt;option value=""&gt; --Choose-- &lt;/option&gt;
                                      &lt;/select&gt;
                                &lt;/div&gt;
                          &lt;/div&gt;
                        &lt;a href="${cp}/admin.jsp"&gt;Submit&lt;/a&gt;                         &lt;/div&gt;                   
                          &lt;br/&gt;
                      &lt;/form&gt;
                  &lt;/div&gt;
  </code></pre>
  
  <p>admin.jsp</p>
  
  <pre><code>&lt;div ng-controller="mainController"&gt;
        {{id.serviceFile}}
  &lt;/div&gt;
  </code></pre>
  
  <p>admin.js</p>
  
  <pre><code>    var app = angular.module('admin', ['viewServices']); 
      app.controller('mainController', ['$scope','$rootScope', '$http', 'SelectedFile', function($scope, $rootScope, $http, SelectedFile) {   
  
          $scope.id = SelectedFile; 
      }]);  
  app.controller('fileController', ['$scope','$rootScope', '$http','SelectedFile' , function($scope, $rootScope, $http, SelectedFile){
  
      $http({
          method: 'GET',
          url :'hrp/filelist' 
      }).success( function(data,status,headers,config){ 
          data.file_list.splice(0, 1) // to remove header row
          $scope.fileList=data.file_list
          $scope.selectedFile = SelectedFile;
         alert($scope.fileList)
      }).error(function(){
          alert("error")
      })  
  }]);
  </code></pre>
  
  <p>service.js</p>
  
  <pre><code>    var viewServices = angular.module('viewServices', []);
  
  viewServices.factory('SelectedFile', function() {
    return {
      serviceFile:''
    };
  });
  </code></pre>
  
  <p>And all the scripts are included.
   So i just want that  mainController should return something in $scope.id </p>
  
  <p>Please Help</p>