AngularJS中的$http服务请求数据
来源:互联网 发布:虚拟机mac os x 10.10 编辑:程序博客网 时间:2024/05/16 17:51
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title></title> <script type="text/javascript" src="../AngularJS/angular.js" ></script> <script> var app = angular.module("myApp",[]); app.controller("myCtrl",function($scope,$http){ //$scope.users; $http({ method:"get", url:"myJson.json" }).then(function success(response){ //console.log(response.data[0].name); $scope.users = response.data; //console.log(users); },function error(){ console.log("失败"); }); }); </script> </head> <body ng-app="myApp" ng-controller="myCtrl"> <center> <table border="1px" cellpadding="10" cellspacing="0"> <caption>用户信息表</caption> <thead> <tr> <th>ID</th> <th>用户名</th> <th>年龄</th> </tr> </thead> <tbody> <tr ng-repeat="user in users"> <td>{{user.id}}</td> <td>{{user.name}}</td> <td>{{user.age}}</td> </tr> </tbody> </table> </center> </body> </html>
阅读全文
0 0
- AngularJS中的$http服务请求数据
- AngularJs $http 请求服务
- AngularJs服务-http请求
- AngularJs $http 请求服务
- AngularJs $http 请求服务
- AngularJS中的 $http服务
- angularJs中的http服务
- AngularJs $http 请求服务整理
- Angularjs $http 请求数据(get.post)
- php + angularjs $http get 请求 显示数据
- angularjs $http请求数据序列化
- AngularJs——$http请求数据
- 修改AngularJS中的$http cache中的数据
- 使用angularjs异步请求数据(http请求或者使用Websocket)的时候,更新$scope中的dom的方法
- angularjs结合$http、$q服务实现多个异步请求
- $http AngularJS异步请求
- angularJS --$http请求方式
- angularJS的http请求
- (Python)异常处理try...except、raise
- 学习阿里巴巴开发手册-8
- Ubuntu14.04虚拟机和宿主机(win7)之间的文件传输 (FTP)篇
- 嵌套的子类
- angularjs 实现简单的快递页面
- AngularJS中的$http服务请求数据
- jQuery 自定义动画
- jmeter http 请求返回socket closed的解决办法
- 用 Command设计模式实现 Undo和Redo 功能
- 计算圆形和长方形的面积
- Python的命令行交互式环境
- centos6.8下redis的安装和配置
- Python lambda介绍
- 在windows下使用tensorbord