title: Angularjs: add service to angular.module
body: <p>I want use a service in a angular.module.</p>
  
  <p>I have a <code>record.js</code> for <code>RecordCtrl</code> and I want use <code>requestCurrentUser</code> fnction that exist in <code>sessionService.js</code>. I use <code>Session</code> for pass data between controller and service. I send a request from <code>record,js</code> by <code>requestCurrentUser</code> function like below:</p>
  
  <pre><code>'use strict';
  var app = angular.module('app');
  app.controller('RecordCtrl',['$scope','Session','Records',function($scope, Session, Records){
      $scope.user = Session.requestCurrentUser();
  }]);
  </code></pre>
  
  <p>and I recieve this in <code>sessionService.js</code> like below:</p>
  
  <pre><code>  'use strict';
     angular.module('sessionService', [])
      .factory('Session', function($location, $http, $q) {
          var service = {
  
              requestCurrentUser: function() {
                      return $http.get('/api/users').then(function(response) {
                          service.currentUser = response.data.user;
                          return service.currentUser;
                      );
                  }
              },
              currentUser: null,
          return service;
      });
  </code></pre>
  
  <p>I can get data correctly in <code>requestCurrentUser</code>, but I cannot recieve this data in <code>record.js</code>. When I echo data in <code>sessionService.js</code>, I can see below data:</p>
  
  <pre><code>Object {id: 2, email: "mgh@mgh.com", created_at: "2014-08-11T08:37:59.981Z", updated_at: "2014-08-26T08:03:27.702Z"} 
  </code></pre>
  
  <p>But I cannot recieve this data in <code>record.js</code> and I get an empty object like below:</p>
  
  <pre><code>[object Object] 
  </code></pre>
  
  <p>I think the problem of code is about <code>Session</code> that I use in 2 <code>js</code> file(<code>record.js</code> and <code>sessionService.js</code>). For add dependency, I have  a <code>app.js</code> that include dependencies on this. </p>
  
  <p><code>app.js</code>:</p>
  
  <pre><code>'use strict';
  angular.module('app',['ngRoute', 'ngResource', 'sessionService', 'recordService'])
  </code></pre>
  
  <p>I cannot find the problem, I add <code>sessionService.js</code> to <code>record.js</code> by below code:</p>
  
  <pre><code>app.service('sessionService');
  </code></pre>
  
  <p>But the problem isn't fix. I don't know how can I resolve this problem? Any one have idea for fix this problem?</p>