ng-repeat循環(huán)一旦遇到相同的值時(shí)就失去的循環(huán)的能力
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<script src="https://cdn.bootcss.com/angular.js/1.4.6/angular.min.js"></script>
</head>
<body ng-app="myApp" ng-controller="myCtrl">
<h1 ng-repeat="x in records">{{x}}</h1>
<script>
var app = angular.module("myApp", []);
app.controller("myCtrl", function(scope) {scope.records = [
"菜鳥(niǎo)教程",/////////////////////////////是相同的元素
"菜鳥(niǎo)教程",
"菜鳥(niǎo)教程",/////////////////////////////循環(huán)失敗,沒(méi)有輸出值
"菜鳥(niǎo)教程",
]
});
</script>
</body>
</html>
循環(huán)一個(gè)數(shù)組時(shí)耘子,當(dāng)數(shù)組中存在兩個(gè)相同元素果漾,將循環(huán)失敗失去作用