私はボランティアグループのウェブサイトを修正しようとしています。
私は角度1.6.4に角度1.3.16から、それを更新しようとしているが、私はというエラーメッセージが出てい:
TypeError: $http(...).success is not a function at b.$scope.init (angular-custom.js:107)
を何からそれを引き起こしているように見えるコードを私はそれが.successと角度-custom.jsファイルでのデバッグで言うと.ERROR機能することができます
$scope.init = function(){
$http({
method: 'post',
url: url,
data: $.param({ 'type' : 'getUsers' }),
headers: {'Content-Type': 'application/x-www-form-urlencoded'}
}).
success(function(data, status, headers, config) {
if(data.success && !angular.isUndefined(data.data)){
$scope.post.users = data.data;
}else{
$scope.messageFailure(data.message);
}
}).
error(function(data, status, headers, config) {
//$scope.messageFailure(data.message);
});
};
私も、私は下plunker The 1.3.16 files at Plunker
でファイルを入れています.successと.errorの結果であるかもしれないことを立証してください。しかし、私はAngularをそれを修正する方法で多くを知らない。
私は独学のコーダーであり、どんな助けも素晴らしいので、私はこのグループを立ち上げて実行することができます。
アドバイスを事前にいただきありがとうございます。 ロッド
はい、 '.success'、' .error'はどちらも古くから推奨されなくなり、1.6で完全に削除されました。いくつかの関連する読書:http://www.codelord.net/2015/05/25/dont-use-%24https-success/ – CollinD
'.then(function(response){var data = response.data; .. – Phil
ヒントをお寄せいただきありがとうございます。 –