错误angular.min.js:102错误:[$ rootScope:infdig]

时间:2016-06-14 08:21:49

标签: angularjs html5

当我打开页面时,会发生无限的摘要循环,浏览器无法响应。看一下控制台我可以看到有几个错误。

HTML代码

<html >
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1">        
        <title>test</title>     
        <!-- Bootstrap core CSS -->

        <link href="css/bootstrap.paper.min.css" rel="stylesheet">         

        <script src="js/angular.min.js"></script>   
        <script src="js/jquery-1.10.2.js"></script>
        <script src="js/jquery-ui.js"></script>         
        <script src="js/test.js"></script>
    </head>
    <body ng-app="App" ng-controller="ctrlregister">
        <div>    
            <input type="checkbox" id="chkNewAdd" value="'true'"  ng-true-value="'true'" ng-false-value="'false'" ng-model="Register.newadd" ng-checked="getChecked()" >This Is Also My Billing Address
        </div>
    </body>
</html>

JS代码

app = angular.module('App',[]);

app.controller('ctrlregister', function ($scope, $http, $window) {
   $scope.Register = {newadd: true };
   $scope.dtData = [];
   $scope.getChecked = function () {                    
        $http(
        {
            method: 'post',
            url: 'GService.asmx/fn_GetItems',               
            dataType: 'json',
            headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
        }).success(function (data, status, headers, config) {
            console.log(data);
        }).error(function (data, status, headers, config) {
            console.log(data);
        });

    }; 
});

当我打开页面时,会发生无限的摘要循环,浏览器无法响应。

查看控制台我可以看到有几个错误。

    angular.min.js:102 Error: [$rootScope:infdig] http://errors.angularjs.org/1.3.14/$rootScope/infdig?p0=10&p1=%5B%5D
    at Error (native)
    at http://localhost:9003/js/angular.min.js:6:417
    at l.$digest (http://localhost:9003/js/angular.min.js:123:469)
    at l.$apply (http://localhost:9003/js/angular.min.js:126:58)
    at l (http://localhost:9003/js/angular.min.js:81:171)
    at S (http://localhost:9003/js/angular.min.js:85:301)
    at XMLHttpRequest.D.onload (http://localhost:9003/js/angular.min.js:86:315)(anonymous function) @ angular.min.js:102(anonymous function) @ angular.min.js:76$apply @ angular.min.js:126l @ angular.min.js:81S @ angular.min.js:85D.onload @ angular.min.js:86
angular.min.js:6 Uncaught Error: [$rootScope:infdig] http://errors.angularjs.org/1.3.14/$rootScope/infdig?p0=10&p1=%5B%5D(anonymous function) @ angular.min.js:6$digest @ angular.min.js:123$apply @ angular.min.js:126l @ angular.min.js:81S @ angular.min.js:85D.onload @ angular.min.js:86

请帮忙。

感谢。

0 个答案:

没有答案