实际上正在关注春季教程..来到Angularjs,他正在使用.succes
var app=angular.module("MyApp",[]);
.controller("MyController",function($scope,$http){
$scope.pageProduits=null;
$http.get("http://localhost:8080/chercherProduits?mc")
.success(function(data){
$scope.pageProduits=data;
})
.error(function(err){
console.log(err);
});
});
现在我的问题是成功不起作用,经过搜索后我发现 .success 和 .error 方法已被弃用,并已从 AngularJS 1.6 中删除。我必须使用标准的 .then 方法。有人可以使用 then 方法将现有代码转换为代码吗?我试过了,但我失败了,谁能帮助不熟悉 javaScript 的 plz bcz?谢谢