I\'m still new to AngularJS, so I\'m just trying to do a simple CRUD app. Currently I pull the data (in a JSON file) with $http in a div handled by
CRUD should be handled in a factory or service, not in the controller. My understanding is that a controller is only responsible for communication between the views and services.
Edit 1: excerpt from John Papa Style Guide (Angular -1) - Defer logic in a controller by delegating to services and factories.
Why?: Logic may be reused by multiple controllers when placed within a service and exposed via a function.
Why?: Logic in a service can more easily be isolated in a unit test, while the calling logic in the controller can be easily mocked.
Why?: Removes dependencies and hides implementation details from the controller.
Why?: Keeps the controller slim, trim, and focused.
https://github.com/johnpapa/angular-styleguide/blob/master/a1/README.md#style-y035