so... I want to get the nested resources of a parent resource.
I want to show all the PAGES of a certain BOOK.
It would be nice to do it with restangular somehow. It seems like I ought to be able to when I look at the docs. Here is a hack I've made in angularJS that works, but I feel like I should be making this happen with Restangular:
$scope.getPages = () ->
Restangular.one('books', 8).getList('pages').then (response) ->
console.log(response)
$scope.pages = $filter('filter')(response, book_id: 8)
Restangular.one('books', 8).getList('pages') returns ALL the pages from ALL the books. I don't get that.... shouldn't it return just the pages from book 8?
Anyway, from there I'm just filtering the pages so I only end up with the pages from book 8.
But can't I do this with Restangular somehow?
PS, There are no examples I've found that use the $filter from AngularJS in a js file like this... everything is done through HTML like "page in pages | filter: {book_id: 8}"