How to use ng-filter Json [@attributes] using Angularjs? -
i'm trying filter sports feed using sports id. json feeds @attribute based feed.
json feeds
series: [ { @attributes: { id: "cdf590b4-0206-45b0-9122-20eae46a2b27", name: "pakistan tour of sri lanka, 2015", year: "2015" }, match: [ {}, {}, {}, {} ], comment: [] }, { @attributes: { id: "324e971e-2044-4fa6-bdb2-0c47c99da64e", name: "south africa tour of bangladesh, 2015", year: "2015" }, match: [ {}, {}, {}, {} ], comment: [] },
my controller
--so controller code.-- $http.get('http://example.com/cricket.php').then(function(response) { $scope.sports = sports; $scope.whichsports = $state.params.id; }
this view filter code
<ion-item ng-repeat="sport in sports | filter: { id : whichsports }">
so please me.!
advance thanks.
probably $scope.sports = sports;
should instead $scope.sports = response;
and in ng-repeat
sport
attributes sport['@attributes']
Comments
Post a Comment