Following is the ng-repeat markup:
<tbody>
<tr ng-repeat=
"(k, v) in loanapps | filter:SelectedStatus | filter:SelectedBorrower track by $index">
<td>{{v.Id}}</td>
<td><a ui-sref="adminloandetails({loanid:{{v.Id}}})">{{v.Name}}</a></td>
<td class="hidden-xs">{{v.AmountYouWishToBorrow | currency:"€"}}</td>
<td><span ng-class=
"{'label label-default': v.LoanStatus == 'Waiting for Meeting', 'label label-success': v.LoanStatus == 'Under Review'}">
{{v.LoanStatus}}</span></td>
<td>{{v.ApplicationDate | date:'yyyy-MM-dd HH:mm:ss'}}</td>
<td><a ui-sref="adminloandetails({loanid:{{v.Id}}})" class=
"btn dark btn-sm btn-outline sbold uppercase">View</a></td>
</tr>
</tbody>
When applying the filter all the data filters as expected only the v.Id
is not updated according to the row value but it remains same as the previous value. That means that the id passed to the adminloandetails view is not correct.
Even the first td which contains the id is updated accordingly, only the v.Id within the ui-sref is not updating.
Any idea what do I need to change?
Try this ui-sref="adminloandetails({loanid: v.Id})"
You dont need to interpolate the values you want to pass to ui-sref because the directive already accepts expressions!