Filter in ng-repeat with objects
Why ng-repeat won't support filtering with objects ?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
MayankPosted Nov 29, 2016, 9:16 AM
You selected: {{selectedCar}}
{ Name: "Alto", Createdby: "Maruti",IsActive:"true" },
{ Name: "Figo", Createdby: "Ford",IsActive:"true" },
{ Name: "Innova", Createdby: "Hyundai", IsActive: "true" },
{ Name: "TATA", Createdby: "Nano", IsActive: "true" },
{ Name: "Maruti 800", Createdby: "Maruti", IsActive: "false" },
];
$scope.cars = cars;
$scope.update = function () {
$scope.cars = $filter('filter')(cars, { Createdby: $scope.selectedCar });
}
Sreekanth ReddyPosted Nov 29, 2016, 2:00 AM