Angular: ng-repeat scope - 14410993

http://angularjs.org/

HTML

<div ng-controller="MyCtrl">
    <input type="text" ng-model="cntInputs" placeholder="#Inputs"><br/>
        
    <input ng-repeat="i in getTimes()" type="text" placeholder="{{i}}" id="input_{{i}}">
        
    <ul>
        <li ng-repeat="j in getTimes()">
            Inputed value is: {{getValue(j)}}
        </li>
    </ul>
</div>

CSS

input{
    width: 20px;
}

JavaScript

var myApp = angular.module('myApp', []);


function MyCtrl($scope) {
    $scope.cntInputs = 0;
    
    $scope.getTimes=function(){
	    var a = new Array();

	    for(var i=1; i <= $scope.cntInputs; i++)
			a.push(i);

	    return a;	    
	};
    
    $scope.getValue = function(id){
        //here get the value of that inserted in the element with the id of "input_" + id
        return angular.element("input_" + id);
    }
}