2

What is the Angular convention or standard for using $http to hit an API. I am performing CRUD within my controller and it is getting very fat. Is it common to move this to a factory or is it common to perform these actions in a controller?

1

1 Answer 1

1

If you are using API are pure rest then you can use ngResource or Restangular and if not then better to use services for that.Below is the link why we should thin slice controller and have more business logic in services or factory

http://toddmotto.com/rethinking-angular-js-controllers/

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.