Angular.jsで提供されているpromise APIを使用して$ http呼び出しの結果に関係なく、関数を実行するにはどうすればよいですか?
$http({
method: 'POST',
url: submitUrl,
data: $scope.data
})
.success(function(data) {
// execute this code on success
})
.error(function(data) {
// execute this code on error
})
.complete(function() {
// execute this code regardless of outcome
});
リクエストが完了すると、これを使用してAJAXスピナーアイコンを非表示にすることができます。リクエスト結果にかかわらず、スピナーを非表示にしたい場合があります。
この方法で何を達成したいですか? –