0

I mean that in Marionette you can set View-Collection-Model mapping, and when you call collection.remove(model) Marionette find and delete model from collection, sent delete request to the server and finally update the view which displays collection items.

Does Angular has same functionality?

Or I have to find deleting element in $scope.collection and remove it, delete it from server and manually update the view?

Cherry
  • 31,309
  • 66
  • 224
  • 364

1 Answers1

0

Check out angular $resource abstraction... I have another answer here on SO that explains the differences between using $http or $resource. In the end you may end up just doing all the CRUD operations in a service and using the same data object within the controllers from the service see more here: Angular $http vs service vs ngResource

Community
  • 1
  • 1
shaunhusain
  • 19,630
  • 4
  • 38
  • 51
  • The question is not about difference between "$http and $resource". – Cherry May 30 '14 at 04:32
  • Right I understand that my point was if you abstract everything into a service as I explain in that answer you can just re-use the data in the controller. Then if you are using $resource you can also use the convenience methods to $save or $delete an element that is returned from a query call on the $resource... that will allow you to abstract the handling of the data to a service, the data that the controller scope uses comes directly from the service so changes will be reflected in the view when the service changes the data. – shaunhusain May 30 '14 at 04:37
  • Also since you didn't mention $http or $resource I figured the explanation would be helpful since you will need something to do the communicating with the server. – shaunhusain May 30 '14 at 04:38