AngularJS XMLHttpRequest


  Translation results:

$http is a core service in AngularJS, used to read data from remote servers.

AngularJS XMLHttpRequestsyntax

$http is a core service in AngularJS, used to read data from remote servers.

AngularJS XMLHttpRequestexample

// 简单的 GET 请求,可以改为 POST
$http({    method: 'GET',    url: '/someUrl'
}).then(function successCallback(response) {        
// 请求成功执行代码    
}, function errorCallback(response) {
        // 请求失败执行代码
        });

Popular Recommendations

Home

Videos

Q&A