Best way to invoke Rest APIs from angularjs?

后端 未结 6 407
遇见更好的自我
遇见更好的自我 2020-12-28 18:44

From where should REST API request be invoked from angular js?

I.e. from controller, module, service, factory. I am totally confused that what should be the right w

6条回答
  •  独厮守ぢ
    2020-12-28 19:06

    As long as you use the $http service it doesnt really make any difference

    Although there is the provider methodology which states that you should have a data provider in the client side as well as the server side

    For this matter I suggest a factory which exposes the methods you want and is utilizing the $http service itself

提交回复
热议问题