我的工作我的第一個角的應用程序和正在以下錯誤:
Uncaught Error: 10 $digest() iterations reached. Aborting!
我想我已經分離出的源我使用隨機的()功能。從我讀到的這個錯誤(https://github.com/angular/angular.js/issues/705)看來,這似乎是有意義的。但是,我不知道如何避免這個錯誤。
我重新錯誤這個簡單的代碼:
randtest.js:
function FirstCtrl($scope) {
$scope.randNum= function(){
var rando = Math.floor(Math.random()*100);
return rando;
};
}
的index.html
<!doctype html>
<html ng-app>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.min.js"></script>
<script src="randtest.js"></script>
</head>
<body>
<div ng-controller="FirstCtrl">
<h1>{{randNum()}}</h1>
</div>
</body>
</html>