In my controller, I have a function for creating resources with ngResource
app.controller 'CalculationsCtrl', ($scope, Calculation)->
$scope.save = ()->
$scope.busy = true
Calculation.create($scope.calculation,
(successResult)->
console.log ("sucess")
, (failResult)->
console.log ("failure")
console.log("code after callbacks")
$scope.busy = false
After the callbacks of .create
are executed, I want to run the code below
console.log("code after callbacks")
.
I attempted using .then
but it appears that ngResource does not support it.
Calculation.create(...).then is not a function
.
Is there an equivalent method to .then
for ngResource?