I have a resource in AngularJS, for example
var Posts = $resource('posts/:postId', { postId: '@_id' })
I can query a list (array) of all posts with
$scope.posts = Posts.query();
I can create a single post in the constructor
$scope.post = new Posts({
title: ...,
content: ...
});
But what I like to but cant do is: create a list of posts with that constructor, like:
$scope.posts = new Posts([
{
title: ...,
content: ...
},
{
title: ...,
content: ...
},
{
title: ...,
content: ...
},
]);
With this I can only do $scope.posts.save() which tries to push the whole list to a single post and leads to an error. Isn't it possible to $scope.posts[...].save()/$scope.posts[...].remove() them individually?