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

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

1 $http.get('/api/user/showname2', {
2 
3 }).then(function (result) {
4   
5   alert(result.data);
6 
7 }).catch(function (result) {
8 
9 });
原文地址:https://www.cnblogs.com/junglexj/p/6486390.html