Skip to content Skip to sidebar Skip to footer

Order Of Executing Requests With Angularjs's Ng-resource? Pt2

This is a follow-up question to Part1. Part 2: books_ctrl.js.coffee myApp.controller 'BooksCtrl', ($scope, Book) -> $scope.save = () -> if $scope.book.id? Book.up

Solution 1:

You can do:

Book.save($scope.book, $scope.getBooks)

Or:

Book.save($scope.book).$promise.then($scope.getBooks)

Post a Comment for "Order Of Executing Requests With Angularjs's Ng-resource? Pt2"