Is there a way to use 1 instead of 0 for $index in ng-repeat as the initial item? Im not trying to filter out the first item in the array. It is for paypal they want the first to be item_num_1... using 0 doesnt work as in
<div ng-repeat = "item in items">
<input type ="hidden" name ="item_num_{{$index}}" value ="item_num_{{item.id}}">
//the rest like this
</div>
Maybe you can try this. I am not sure if it works though. Good luck
<div ng-repeat = "item in items track by $index">
<input type ="hidden" name ="item_num_{{$index + 1}}" value ="item_num_{{item.id}}">
//the rest like this
</div>
Why not to do just
{{$index+1}}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With