http加interval和耗时2秒

<!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",[]);
             var ss = app.controller("mycontr",function($scope,$location,$timeout,$interval,$http){
                $scope.myurl = $location.absUrl();
                $scope.ahost = $location.host();
                $scope.bprotocol = $location.protocol();
                $scope.cpath = $location.path();
                $scope.dport = $location.port();
                
                $scope.str="";
                $timeout(function(){
                    $scope.str="2秒";
                },2000);
                
                $scope.currentTime="";
                $interval(function(){
                    var _dater = new Date().toLocaleTimeString();
                    $scope.currentTime=_dater;
                });
                $http({
                    method:"get",
                    url:"http://result.eolinker.com/pWEDzFn48fd146c3a725c1571f997a44281b94d1201b661?uri=myjson1"
                }).then(function success(response){
                    $scope.jsonFromNet = response.data;
                    
                },function error(response){
                    
                });
                $scope.deleteG = function($index){
                    $scope.jsonFromNet.data.splice($index,1);
                }
                
            });
            
        </script>
        
    </head>
    <body ng-app="myapp" ng-controller="mycontr" >
        <p>{{str}}</p>
        <p>{{currentTime}}</p>
        
        <table>
            <tr>
                <td>序号</td>
                <td>id</td>
                <td>iten</td>
                <td>title</td>
                <td>img</td>
                <td>操作</td>
            </tr>
            <tr ng-repeat="g in jsonFromNet.data">
                <td>{{$index}}</td>
                <td>{{g.detectionId}}</td>
                <td>{{g.detectionItem}}</td>
                <td>{{g.categoryTitle | limitTo:6}}</td>
                <td><img src="http://www.sinaimg.cn/ty/deco/2013/1108/nbalogo/20.png" /></td>
                <td><input type="button" ng-click="deleteG($index);" value="删除" /></td>
            </tr>
        </table>
        
        
        
    </body>
</html>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值