I want to filter angularjs for the following json format value
[
{"id":"1","video_title":"Sample1","tags":"2,12,13","featured":"1"},
{"id":"2","video_title":"Sample2","tags":"5,13","featured":"1"},
{"id":"2","video_title":"Sample3","tags":"2,13","featured":"0"}
]
<ul><li ng-repeat="single in all_json | filter:customFilter"></li></ul>
<a ng-click="filterBasedonTag(2)">Filter</a>
// Script
$scope.filterBasedonTag = function(x) {
$scope.customFilter = x;
}
If I pass tags value = 2 I want to print only video_title "sample1" and "Sample 3". It is possible to filter. Is any solution please. Thanks to all