I think what you mean is to show/hide the ng-repeat contents as per the id that is to be passed.
I have an updated fiddle to handle precisely that.
HTML code:
<div ng-controller="MyCtrl">
<table id="1" border=1>
<tr ng-repeat="line in lines" ng-show="line.id == 1">
<td>{{line.text}}</td>
</tr>
</table>
<table id="2" border=1 style="margin-top:10px">
<tr ng-repeat="line in lines" ng-show="line.id == 2">
<td>{{line.text}}</td>
</tr>
</table>
</div>
JS Code:
var myApp = angular.module('myApp', []);
//myApp.directive('myDirective', function() {});
//myApp.factory('myService', function() {});
function MyCtrl($scope) {
$scope.lines = [{
id: 1,
text: 'res1'
}, {
id: 1,
text: 'res2'
}];
}
UPDATE (json without the id attribute):
Fiddle
HTML Code:
<div ng-controller="MyCtrl">
<table id="1" border=1>
<tr ng-repeat="line in lines" ng-show="id == 1">
<td>{{line.text}}</td>
</tr>
</table>
<table id="2" border=1 style="margin-top:10px">
<tr ng-repeat="line in lines" ng-show="id == 2">
<td>{{line.text}}</td>
</tr>
</table>
</div>
JS Code:
var myApp = angular.module('myApp', []);
//myApp.directive('myDirective', function() {});
//myApp.factory('myService', function() {});
function MyCtrl($scope) {
$scope.id = 1;
$scope.lines = [{
text: 'res1'
}, {
text: 'res2'
}];
}