title: AngularJS Service not waiting for other service to complete
body: <p>I've got an issue when a service is calling a service.  It seems that things are executing out of order.</p>
  
  <pre><code>.service('addressService', function($http) {
      var addressService = this;
      addressService.getLatitudeLongitude = function(address) {
          console.log('in addressService.getLatitudeLongitude')
          $http.get('/location?address=' + encodeURIComponent(address))
          .success(function(data, status, headers, config) {
              console.log('success')
              console.log(data);
              return data;
          })
          .error(function(data, status, headers,config) {
              console.log('error')
          });
      };
  })
  
  .service('weatherService', function($http, addressService){
      var weatherService = this;
  
      weatherService.getWeather = function(latitude, longitude) {
          console.log('get weather')
          $http.get('/all_weather?latitude=' + latitude + '&amp;longitude=' + longitude)
          .success(function(data, status, headers, config) {
          return data;
          })
          .error(function(data, status, headers, config) {
              return null;
          });
      };
  
      weatherService.getCurrentWeather = function(address) {
          var lat_lon = addressService.getLatitudeLongitude(address) 
          console.log(lat_lon)
          return weatherService.getWeather(lat_lon.lat, lat_lon.lng).currently;
      };
  })
  </code></pre>
  
  <p>The output is:</p>
  
  <pre class="lang-js prettyprint-override"><code>weather.js:25 getCurrentWeatherByAddress 
  weather.js:99 in addressService.getLatitudeLongitude
  weather.js:129 undefined
  angular.js:11655 TypeError: Cannot read property 'lat' of undefined
      at weatherService.getCurrentWeather (weather.js:130)
      at weather.getCurrentWeatherByAddress (weather.js:28)
      at ib.functionCall (angular.js:12404)
      at hint.js:798
      at n.$get.n.$eval (angular.js:14466)
      at n.$get.n.$apply (angular.js:14565)
      at n.scopePrototype.$apply (hint.js:1478)
      at HTMLButtonElement.&lt;anonymous&gt; (hint.js:797)
      at HTMLButtonElement.c (angular.js:3032)
  weather.js:102 success
  weather.js:103 Object {lat: 44.8735964, lng: -93.2835137}
  </code></pre>
  
  <p>It appears that <code>weatherService.getCurrentWeather(address)</code> is trying to continue past <code>addressService.getLatitudeLongitude(address)</code> before <code>addressService.getLatitudeLongitude(address)</code> is finished making the request.  After <code>weatherService.getCurrentweather</code> errors out, the rest of the logs from <code>addressService.getLatitudeLongitude</code> are outputted.</p>