我正在研究angularjs。我在我的html表中使用ng-show和ng-hide。我需要在if条件中显示值以同样的方式显示我的融合图中的相应值。
这是我的html
和script
的index.html
<tbody>
<tr ng-hide="content == 'other'" ng-repeat='p in view_data'>
<td><span>{{p.product}}</span></td>
<td><span>{{p.bucket}}</span></td>
<td><span>{{p.countOfAllocatedAccount}}</span></td>
<td><span>{{p.countOfCollectedAccount}}</span></td>
<td><span>{{p.countOfPendingCollectionOfAccounts}}</span></td>
</tr>
<tr ng-show="content == 'other'" ng-repeat='p in view_data'>
<td><span>{{p.product}}</span></td>
<td><span>{{p.bucket}}</span></td>
<td><span>{{p.sumOfAllocatedAccount}}</span></td>
<td><span>{{p.sumOfCollectedAccount}}</span></td>
<td><span>{{p.sumOfPendingAllocatedAndCollectedAmounts}}</span></td>
</tr>
</tbody>
的script.js
如果ng-hide="content == 'other'"
显示此值
if(data[p].product==products[j])
{
var productWiseAllocation = {};
productWiseAllocation.name=data[p].product;
productWiseAllocation.series= data[p].bucket;
productWiseAllocation.amount= data[p].countOfAllocatedAccount;
//productWiseAllocation.amount= data[p].sumOfAllocatedAccount;
productWiseAllocationarr.push( productWiseAllocation);
var productWiseCollection ={};
productWiseCollection.name=data[p].product;
productWiseCollection.series=data[p].bucket;
productWiseCollection.amount=data[p].countOfCollectedAccount;
//productWiseCollection.amount=data[p].sumOfCollectedAccount;
productWiseCollectionarr.push( productWiseCollection);
}
如果ng-show="content == 'other'"
我需要在融合图表中显示这些值。
else{
var productWiseAllocation = {};
productWiseAllocation.name=data[p].product;
productWiseAllocation.series= data[p].bucket;
productWiseAllocation.amount= data[p].sumOfAllocatedAccount;
//productWiseAllocation.amount= data[p].sumOfAllocatedAccount;
productWiseAllocationarr.push( productWiseAllocation);
var productWiseCollection ={};
productWiseCollection.name=data[p].product;
productWiseCollection.series=data[p].bucket;
productWiseCollection.amount=data[p].sumOfCollectedAccount;
//productWiseCollection.amount=data[p].sumOfCollectedAccount;
productWiseCollectionarr.push( productWiseCollection);
}
任何人都可以帮助我吗?