I think that I am missing something obvious but I can't quite figure this out. I am executing a promise in a controller that backs a modal dialog.
Here is the code;
$scope.elevate = ->
$auth.authenticate('github', { auth_level: 'elevated' }).then((response) ->
$scope.user.auth_level = 'elevated'
return
).catch (response) ->
alert response
return
return
The elevate
function is called when the user clicks a button on the modal dialog. The code executes fine (no errors) but the promise is never resolved. The 'then' function is never called.
I read elsewhere that a call to $rootScope.$digest
would do the trick but trying that just gives a "$apply already in progress" error.
Am I missing something obvious here?