In an MVC framework, the data are handled in the model.
In AngularJs, is it common to handle the data directly in a controller, or should it be done in a service instead?
There is no harm in firing XHRs from within a controller if controller is the only one using the call.
But if multiple controllers need to make the same call you would better move it inside a service for ease of access.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With