我是AngularJs世界的新手 - 我试图从两个REST WS调用中获取数据.
第一个返回一组数据(工作正常) - 使用第一个数据的值,我需要进行另一个webservice调用并检索数据并在表中打印.
以下是我到目前为止所尝试的内容:HTML:
<table ng-table="tableParams" id="request_table" class="table table-striped table-bordered" cellspacing="0" width="100%">
<thead>
<tr>
<th>Number</th>
<th>Price</th>
<th>Short Description</th>
<th>Requested for</th>
<th>State</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="request in req_list | orderBy:sortType:sortReverse | filter: searchItem">
<p ng-repeat="item in fetchRequest(request.price)"></p>
<td>{{request.number }}</td>
<td>{{request.price}}</td>
<td>{{request.short_description}}</td>
<td>{{request.requested_for.display_value}}</td>
<td>{{request.stage}}</td>
</tr>
</tbody>
Run Code Online (Sandbox Code Playgroud)
脚本:
angular.module('sc_request_list')
.controller('MyRequestItems', [
'$scope',
'$http',
function($scope, $http) {
$scope.sortType = 'number' //set the default sort type
$scope.sortReverse = false; // set the default sort order
$scope.searchItem // set the default …Run Code Online (Sandbox Code Playgroud)