1
我有以下的角腳本,它什麼也不做,但創建對象的列表:顯示錶NG-單擊當基於ID
//To get the existing records
$scope.get_records = function(){
filter_data = {set__iexact: $scope.final_data.set};
bin.get(filter_data,
function(data){
$scope.main_list = data['objects'];
console.log($scope.main_list);
angular.forEach($scope.main_list, function(f) {
});
},function(data, status){
console.log('Stage1: Internal error while loading initial data:'+status);
}
)};
每個記錄的唯一字段是id。我在HTML中將這些ID顯示爲一個表格(tr)。
<table class="table table paleblue table-fixed">
{%verbatim %}
<tr align="center" ng-repeat="f in main_list" ng-cloak>
<td><button class="btn btn-small">{{f.id}}</button></td>
</tr>
</table>
我的目標是展現出表的當前td
以下,其中只包含特定ID的元素。我怎樣才能做到這一點?如何獲得該特定ID,以便我可以將它與set
一起過濾?任何想法?
* 「我怎麼ID爲」 * ...你說'f.id'是不正確的?問題/問題陳述不是很清楚 – charlietfl
f.id是正確的。但我需要獲取該特定ID的對象並顯示在表格中。 :) – vellattukudy
而這樣做的問題是什麼具體? – charlietfl