我想问一下这种方法的区别 我关注的是.then和.success,function以及.error之间的区别 感谢。
// Simple GET request example:
$http({
method: 'GET',
url: '/someUrl'
}).then(function successCallback(response) {
// this callback will be called asynchronously
// when the response is available
}, function errorCallback(response) {
// called asynchronously if an error occurs
// or server returns response with an error status.
});
和
// Simple GET request example:
$http({
method: 'GET',
url: '/someUrl'
}).success(function successCallback(response) {
// this callback will be called asynchronously
// when the response is available
}).error( function(data) {
// called asynchronously if an error occurs
// or server returns response with an error status.
});
答案 0 :(得分:6)
String form1_text = form1textbox.getText();
form2.form2textbox.setText(form1_text);
和.then()
都是指承诺它异步运行并等待响应,如果它已满足您的请求,则.sucess()
否则resolve
它。
reject
和.success
,您可以找到有关文档的更多详细信息