-
Notifications
You must be signed in to change notification settings - Fork 26
Open
Description
Trying to use this in resolve block of route/state definition.
With ngResource I can access the result promise directly as .$promise. This explains why it's used.
While djResource also has a .$promise property it seems to be resolved after $http returns, but before it's populated with response data, so I can't use that like the ngResource one.
Something like this is required then (coffescript syntax):
resolve:
apartment: (djResource, $stateParams, $q) ->
deferred = $q.defer()
djResource('/url/:id/').get {id: $stateParams.id}, (response) ->
deferred.resolve(response)
return deferred.promise
Am I missing something, is there a way to access the result promise?
Otherwise I think .$promise should be resolved after it's populated with data, mimicking ngResource.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels