           return
         d.promise
       getCityDetails: (query) ->
-        d = .defer()
-        (
+        d = $q.defer()
+        $http(
           method: 'GET'
           url: 'http://autocomplete.wunderground.com/aq?query=' + query).success((data) ->
           d.resolve data.RESULTS

        # Hide the reslist on blur
        input.bind 'blur', (e) ->
          scope.reslist = null
          scope.()
          return
        return

  }
).controller('MainCtrl', (, , Weather, UserService) ->
  .date = {}

  updateTime = ->
    .date.tz = new Date((new Date).toLocaleString('en-US', timeZone: .user.timezone))
     updateTime, 1000
    return

  .weather = {}
  .user = UserService.user
  Weather.getWeatherForecast(.user.location).then (data) ->
    .weather.forecast = data
    return
  updateTime()
  return
).controller 'SettingsCtrl', (, , Weather, UserService) ->
  .user = UserService.user

  .save = ->
    UserService.save()
    .path '/'
    return

  .fetchCities = Weather.getCityDetails
  return

# ---
# generated by js2coffee 2.2.0


          val = ele.val()
          if val.length < minKeyCount
            if timer
              $timeout.cancel timer
            scope.reslist = null
            return
          else
            if timer
              $timeout.cancel timer
            timer = $timeout((->
              scope.autoFill()(val).then (data) ->
                if data and data.length > 0
                  scope.reslist = data
