Сообщение от A1x1On2015
|
$scope.TAB = 1;
|
Так не пойдет.
Поскольку ng-repeat реагирует на изменение массива
Tags...
А свойство
$scope.TAB будет "жить" своей жизнью.
Сообщение от A1x1On2015
|
как увеличивать tabindex на один при каждой итерации ng-repeat
|
Как вариант...
<!DOCTYPE html>
<html ng-app>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=windows-1251' />
<script src="https://code.angularjs.org/1.3.9/angular.min.js"></script>
<!--
<script src='http://code.jquery.com/jquery-latest.js'></script>
<script src="https://code.angularjs.org/1.3.9/angular-route.js"></script>
<link rel='stylesheet type=text/css href=tmp.css' />
<link rel="stylesheet/less" type="text/css" href="style.less">
<script src="http://cdnjs.cloudflare.com/ajax/libs/less.js/2.5.0/less.min.js"></script>
-->
<style type='text/css'>
</style>
<script type='text/javascript'>
</script>
</head>
<body>
<div ng-init="users = [
{name:'John', age:25, gender:'boy'},
{name:'Jessie', age:30, gender:'girl'},
{name:'Johanna', age:28, gender:'girl'},
{name:'Joy', age:15, gender:'girl'},
{name:'Mary', age:28, gender:'girl'},
{name:'Peter', age:95, gender:'boy'},
{name:'Sebastian', age:50, gender:'boy'},
{name:'Erika', age:27, gender:'girl'},
{name:'Patrick', age:40, gender:'boy'},
{name:'Samantha', age:60, gender:'girl'}
]">
<div ng-repeat='(i, user) in users' tabindex='{{i+1}}'>{{i+1}}. {{user.name}}</div>
</body>
</html>