解决 $http.get(...).success is not a function问题
来源:互联网 发布:国家关于云计算的政策 编辑:程序博客网 时间:2024/06/04 19:37
项目本来用的是CDN上的Angular 1.4开发的,后来因为要换成本地的,就下载了个Angular 1.6,结果运行程序,页面上就报: $http.get(...).success is not a function错误
经查询文档,发现是AngularJs在1.6版本开始,用then和catch 代替了success和error,用PRomise规则。
语法为:
$http(...) .then(function onSuccess(response) { // Handle success var data = response.data; var status = response.status; var statusText = response.statusText; var headers = response.headers; var config = response.config; ... }).catch(function onError(response) { // Handle error var data = response.data; var status = response.status; var statusText = response.statusText; var headers = response.headers; var config = response.config; ... });
阅读全文
0 0
- 解决 $http.get(...).success is not a function问题
- Angular 1.6提示$http.get(...).success is not a function
- angular 1.6 $http.get(...).success is not a function 解决办法
- Angular 1.6提示$http.get(...).success is not a function
- AngularJS 报错: $http(...).success is not a function
- angualrJS跨域请求数据,老是报错: $http.jsonp(...).success is not a function
- Ext.get(...).getValue is not a function
- app.get is not a function解决方案
- $ is not a function 已解决
- RVM is not a function 解决
- 解决object is not a function
- 解决 subject.onNext is not a function
- undefined is not a function错误解决
- $ is not defined $ is not a function 问题
- $ is not a function
- $ is not a function
- is not a function
- 解决Zepto.js不支持animate报错的问题,错误信息$(...).animate is not a function
- 算法中,什么是哈希值,哈希值怎么生成的,有什么用?
- rest返回一直为404
- mongodb安装及100报错
- maven详解-(8)多模块工程
- Laravel模糊查询区分大小写
- 解决 $http.get(...).success is not a function问题
- Java
- BZOJ 2653
- BottomNavigationBar+ViewPager+fragment
- Mysql将a表相应字段插入B表
- 在线编程网站
- C++——【USACO 5.3.3】——Network of Schools
- Redis使用二、redis整合spring(redisTemplate工具类)
- CSDN博客初体验