I\'m trying to create a promise in Angular with the $q service. It returns an object retrieved from a web service. If the object is in the cache, it returns it without calling t
You shouldn't need to wrap everything in the $q() call. In order to promisify navigationMap use $q.when:
$q()
navigationMap
function returnMapAsync() { if (navigationMap) { return $q.when(navigationMap); } return ServerRequest.getNavigationMap(); }