Angularjs 在调用服务器托管文件时返回未定义的get请求
有什么原因不起作用吗Angularjs 在调用服务器托管文件时返回未定义的get请求,angularjs,Angularjs,有什么原因不起作用吗 $http.get('http://localhost:8383/api/login.php').respond(function (method, url, data, headers) { return authorized ? [200, customers] : [401]; }); 我知道另一种方法,但我想知道为什么这不起作用,因为它似乎符合文档中的语法 safari:“未定义不是函数” chrome:“err\u empty\u response
$http.get('http://localhost:8383/api/login.php').respond(function (method, url, data, headers) {
return authorized ? [200, customers] : [401];
});
我知道另一种方法,但我想知道为什么这不起作用,因为它似乎符合文档中的语法
safari:“未定义不是函数”
chrome:“err\u empty\u response”
衷心感谢你的帮助。。。非常感谢 据我所知,没有方法响应:-) 使用有错误的
成功
或使用然后
$http.get('http://localhost:8383/api/login.php').
success(function(data, status, headers, config) {
// this callback will be called asynchronously
// when the response is available
}).
error(function(data, status, headers, config) {
// called asynchronously if an error occurs
// or server returns response with an error status.
});
$http.get('http://localhost:8383/api/login.php')
.then(function(result) {
//USe result here
});
很高兴能帮助您:-)