简体   繁体   English

Angular提供程序和$ http

[英]Angular provider and $http

如果在提供者$get注入$http并执行sam AJAX(用于配置),我确定在请求结束后是否将对此service进行任何操作?

$http returns a promise. $ http返回一个承诺。 If you want to execute some code on receiving a response please put it inside the then method callback of said promise. 如果您想在收到响应时执行一些代码,请将其放在所述promise的then方法回调中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM