I am trying to filter my $scope.contracts
based on the partner's name in HTML. My object structure is as follows:
$scope.contracts = [
{
name: "contract1",
partners : [{name: "John", age:"21"}, {name: "Peter", age: "33"}]
},
{
name: "contract2",
partners : [{name: "George", age:"51"}, {name: "Jack", age: "42"}]
}
];
My filtering code looks like this:
ng-repeat="contract in contracts | filter : {partner: {name: 'John'}}"
. However, despite expecting to retrieve the first contract where the partner's name is 'John', I'm receiving an empty array instead.