在此项目表中基于db表的数据生成。我的loan.html
如下,
<form role="form" class="form-horizontal" name="LoanParaDataForm">
<div class="container">
<div class="box-body">
<div class="form-group">
<div class="col-sm-12">
<div class="table-responsive">
<table id="example5" class="table table-striped table-bordered" cellspacing="0" width="100%" datatable="ng">
<thead>
<tr>
<th>Applied Date</th>
<th>Loan ID</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="x in approvedLoanList">
<td>{{ x.APPLIED_DATE }}</td>
<td>{{ x.ID }}</td>
<td>
<input onclick="location.href='@Url.Action("UnsuccessLoan", "LoanDetails")'" type="button" class="btn btn-danger" value="View Details" ng-click="GetpaymentDetails(x)" />
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</form>
单击按钮时,我需要使用ID
作为参数。 UnsuccessLoan.html
中的数据应基于该ID
生成。这是我在UnsuccessLoan.html
中使用的angularJS代码。那么如何将loan.html
id传递给另一页。
$scope.GetpaymentDetails = function (loan) {
var post = $http({
method: "POST",
url: WebApiBaseUri + "LoanDetails/GetRepayDetails",
dataType: 'json',
data: JSON.stringify(loan),
headers: { "Content-Type": "application/json" }
});
post.success(function (data, status) {
$scope.rejectedLoanList = data;
});
post.error(function (data, status) {
});
};