I need to create a filter in angularjs
My data looks something like this:
[{
name: 'account1',
accounts: [
{
name: 'account2',
accounts: []
},
{
name: 'account3',
accounts: [
{
name: 'account4',
accounts: []
}
]
}
]
}]
I need the filter return the full object if I use account4 for the search text. Or just the first 2 levels if I use account2 etc.
I have searched all over but cant find anything like this and have no idea where to start.