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

时间:2017-03-01 22:57:42   收藏:0   阅读:4020

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 });

 

原文:http://www.cnblogs.com/junglexj/p/6486390.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!