Skip to content

Instantly share code, notes, and snippets.

@nicgirault
Last active June 27, 2016 10:35
Show Gist options
  • Save nicgirault/5f4499e8d287a37171b632649b1b98ab to your computer and use it in GitHub Desktop.
Save nicgirault/5f4499e8d287a37171b632649b1b98ab to your computer and use it in GitHub Desktop.
resolve:
updateDates: ($q, DataUpdate) ->
def = $q.defer()
DataUpdate.find()
.$promise
.then (updateDates) ->
def.resolve updateDates
.catch ->
def.resolve []
return def.promise
resolve:
updateDates: (DataUpdate) ->
DataUpdate.find()
.$promise.catch -> []
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment