src/angular-weather.js
function getWeatherFromServer(city) {
      var deferred = $q.defer();
      var url = openweatherEndpoint;
      var params = {
        q: city,
        units: 'metric',
        APPID: Config.openweather.apikey || ''
      };
      $http({
        method: 'GET',
        url: url,
        params: params,
        withoutToken: true,
        cache: true
      }).success(function(data) {
        // Prepare the Weather object.
        var weatherData = prepareWeather(data);
        setCache(weatherData);

        // Start refresh automatic the weather, according the interval of time.
        options.refresh && startRefreshWeather();

        deferred.resolve(weatherData);
      });

      return deferred.promise;
    }
function getWeatherFromServer(city) {
      var deferred = $q.defer();
      var url = openweatherEndpoint;
      var params = {
        q: city,
        units: 'metric',
        APPID: Config.openweather.apikey || ''
      };
      $http({
        method: 'GET',
        url: url,
        params: params,
        withoutToken: true,
        cache: true
      }).success(function(data) {
        // Prepare the Weather object.
        var weatherData = prepareWeather(data);
        setCache(weatherData);

        // Start refresh automatic the weather, according the interval of time.
        options.refresh && startRefreshWeather();

        deferred.resolve(weatherData);
      });

      return deferred.promise;
    }
function getWeatherFromServer ( city ) { var deferred = $q . defer ( ) ; var url = openweatherEndpoint ; var params = { q : city , units : 'metric' , APPID : Config . openweather . apikey || '' } ; $http ( { method : 'GET' , url : url , params : params , withoutToken : true , cache : true } ) . success ( function ( data ) { // Prepare the Weather object. var weatherData = prepareWeather ( data ) ; setCache ( weatherData ) ; // Start refresh automatic the weather, according the interval of time. options . refresh && startRefreshWeather ( ) ; deferred . resolve ( weatherData ) ; } ) ; return deferred . promise ; }
Return Weather array from the server.

@returns {$q.promise}
Return Weather array from the server .