$http.get(...).then(...).error is not a function

1.6 新版本的AngularJs中用thencatch 代替了success和error,用PRomise规则。
更改写法:api

1 $http.get('/api/user/showname2', {
2 
3 }).then(function (result) {
4   
5   alert(result.data);
6 
7 }).catch(function (result) {
8 
9 });
相关文章
相关标签/搜索