New to angularJs
What are the differences between service, factory, and controller in angularJs, and where do they apply?
为情所困2017-05-15 16:55:20
Controller focuses on business scenarios, that is, serving specific scenarios, so do not reuse controllers. It is recommended to divide controllers in a small range and use parent-child scopes to meet business scenarios.
factory provides some public methods and functions, it is recommended to abstract and reuse factory.
Service is similar to factory. It will be instantiated and can save data. It is used as a communication tool between controllers and is recommended for reuse.