http
来源:互联网 发布:干部动议知乎 编辑:程序博客网 时间:2024/06/05 23:51
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<script src="../angular/angular.js"></script>
<script>
var app=angular.module("myapp",[]);
app.controller("myctrl",function($scope,$http){
$http(
{
methed:"get",
url:"haha.json"
}
).then(
function cg(s){
$scope.users=s.data;
},
function sb(){
$scope.users=null;
}
);
});
</script>
<style>
table tr:nth-child(odd){
background-color:lightgreen;
}
table tr:nth-child(even){
background-color:hotpink;
}
</style>
</head>
<body ng-app="myapp" ng-controller="myctrl">
<center>
<h3>我的用户表</h3>
<table border="1px solide blue" cellpadding="10" cellspacing="0">
<thead>
<tr>
<th>用户名</th>
<th>年龄</th>
<th>性别</th>
<th>操作</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="user in users">
<td>{{user.name}}</td>
<td>{{user.age}}</td>
<td>{{user.sex}}</td>
<td><button ng-click="delete($index)">删除</button></td>
</tr>
</tbody>
</table>
</center>
</body>
</html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<script src="../angular/angular.js"></script>
<script>
var app=angular.module("myapp",[]);
app.controller("myctrl",function($scope,$http){
$http(
{
methed:"get",
url:"haha.json"
}
).then(
function cg(s){
$scope.users=s.data;
},
function sb(){
$scope.users=null;
}
);
});
</script>
<style>
table tr:nth-child(odd){
background-color:lightgreen;
}
table tr:nth-child(even){
background-color:hotpink;
}
</style>
</head>
<body ng-app="myapp" ng-controller="myctrl">
<center>
<h3>我的用户表</h3>
<table border="1px solide blue" cellpadding="10" cellspacing="0">
<thead>
<tr>
<th>用户名</th>
<th>年龄</th>
<th>性别</th>
<th>操作</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="user in users">
<td>{{user.name}}</td>
<td>{{user.age}}</td>
<td>{{user.sex}}</td>
<td><button ng-click="delete($index)">删除</button></td>
</tr>
</tbody>
</table>
</center>
</body>
</html>
阅读全文
0 0
- http
- http
- HTTP
- HTTP
- HTTP
- http
- HTTP
- HTTP
- HTTP
- http
- http
- http
- http
- HTTP
- HTTP
- http
- HTTP
- http
- recyclerview的点击条目删除
- 11-22C/C++/python程序编程
- 几行代码理解Python变量访问的LEGB顺序
- 华展云-让展览更高效 2017第十五届中国国际铸造博览会 第十七届中国国际冶金工业展览会 第十五届中国国际工业炉展览会会刊(参展商名录)
- 媒体化查询
- http
- SpringMVC 处理器映射器、处理器适配器
- CentOS 安装Perl环境
- 数字判断
- 计算Fibonacci数列第n项的第8种方法(数学推导与Python实现)
- Android学习笔记三—自定义控件
- 【Java 并发】Executor框架机制与线程池配置使用
- 微信小程序页面跳转时传值问题
- Ubuntu中怎么启用Crontab日志记录