<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<script type="text/javascript" src="js/angular.js" ></script>
<script>
var app=angular.module("myApp",[]);
app.controller("myCtrl",function($scope,$http){
$scope.jsonFromNet="";
$http({
method:"get",
url:"http://result.eolinker.com/pWEDzFn48fd146c3a725c1571f997a44281b94d1201b661?uri=myjson1"
}).then(function(response){
$scope.jsonFromNet=response.data;
},function Error(response){
alert("发生错误!");
});
$scope.del=function(index){
$scope.jsonFromNet.data.splice(index,1);
}
});
</script>
</head>
<body ng-app="myApp" ng-controller="myCtrl">
<center>
<p>从网络获取json串然后进行展示</p>
<table border="1">
<tr>
<th>序号</th>
<th>条目</th>
<th>信息</th>
<th>内容</th>
<th>图片</th>
<th>操作</th>
</tr>
<tr ng-repeat="d in jsonFromNet.data">
<th>{{$index}}</th>
<th>{{d.detectionId}}</th>
<th>{{g.detectionItem}}</th>
<th>{{d.detectionInfo | limitTo:5}}</th>
<th><img src="http://www.sinaimg.cn/ty/deco/2013/1108/nbalogo/20.png"/></th>
<th><input type="button" ng-click="del(index)" value="删除"/></th>
</tr>
</table>
</center>
</body>
</html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<script type="text/javascript" src="js/angular.js" ></script>
<script>
var app=angular.module("myApp",[]);
app.controller("myCtrl",function($scope,$http){
$scope.jsonFromNet="";
$http({
method:"get",
url:"http://result.eolinker.com/pWEDzFn48fd146c3a725c1571f997a44281b94d1201b661?uri=myjson1"
}).then(function(response){
$scope.jsonFromNet=response.data;
},function Error(response){
alert("发生错误!");
});
$scope.del=function(index){
$scope.jsonFromNet.data.splice(index,1);
}
});
</script>
</head>
<body ng-app="myApp" ng-controller="myCtrl">
<center>
<p>从网络获取json串然后进行展示</p>
<table border="1">
<tr>
<th>序号</th>
<th>条目</th>
<th>信息</th>
<th>内容</th>
<th>图片</th>
<th>操作</th>
</tr>
<tr ng-repeat="d in jsonFromNet.data">
<th>{{$index}}</th>
<th>{{d.detectionId}}</th>
<th>{{g.detectionItem}}</th>
<th>{{d.detectionInfo | limitTo:5}}</th>
<th><img src="http://www.sinaimg.cn/ty/deco/2013/1108/nbalogo/20.png"/></th>
<th><input type="button" ng-click="del(index)" value="删除"/></th>
</tr>
</table>
</center>
</body>
</html>