AngularJS: controller vs service

后端 未结 4 2204
-上瘾入骨i
-上瘾入骨i 2020-12-13 02:16

I have read a couple of posts regarding proper usage of angularjs entities: services, factories, controllers and directives.

My particular concern is a comparison of

4条回答
  •  我在风中等你
    2020-12-13 02:47

    In addition to what have been said above. Controllers may also hold the logic of your application while the application isn't so big. But as you application grows you would need to move the logic to use services(like factory). This would allow variables and functions needed around your application to be easily accessible.

提交回复
热议问题