我有一段响应状态代码为403的代码。问题是它永远不会触发第二个函数,它什么都不做。
我见过类似的错误,但人们使用的是拦截器,但我没有。
Itens.signUp($scope.user, confirmation).then(function (response) {
console.log('success');
},
function (response) {
console.log('error');
});
下面的格式不正确。
.then(function(response) {
console.log('success');
}),
function(response) {
console.log('error');
};
}
应该是这样的:
.then(function(response) {
console.log('success');
}, function(response) {
console.log('error');
});
另外,您也可以这样做:
.then(function () {
console.log('success');
})
.catch(function () {
console.log('error');
});
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句