I have repeated a div by using angular js ng-repeat
<div ng-repeat="exampleData in example">
<input type="text" id="{{ $index }}percentage"/>
<button type="btn btn-success" ng-click="submitted('{{ $index }}fromHours')">Submit</button>
</div>
So, when I click on submit button submitted method will be called with input feilds id passed as parameter in it,
Please take a look at the js code below :
$scope.submitted = function(percentage){
console.log($('#'+percentage).val());
}
Now when I use the parameter and print its value I'm getting error, Saying
Syntax error, unrecognized expression: #{{ $index }}percentage
How should I get the exact value of the input type with {{ $index }}percentage as ID
I have written $index to have the unique id as the text box will be repeated many times.
Please help, thanks in advance :)