angular.service vs angular.factory

后端 未结 9 2141
走了就别回头了
走了就别回头了 2020-11-22 02:50

I have seen both angular.factory() and angular.service() used to declare services; however, I cannot find angular.service anywhere in official documentation.

9条回答
  •  悲&欢浪女
    2020-11-22 03:00

    I have spent some time trying to figure out the difference.

    And i think the factory function uses the module pattern and service function uses the standard java script constructor pattern.

提交回复
热议问题