was just wondering if you can filter an existing array with another array of filter.
So say our original json was:
[
{
"bookname": "harryporter",
"year": "2000",
"author":"J. K. Rowling"
},
{
"bookname": "Sleepless",
"year": "2003",
"author":"Connie Ann Michael"
},
{
"bookname": "No man's land",
"year": "1993"
"author":"Harold Pinter"
}
];
Filter array:
[
"year":"1993"
"bookname":"No man"
]
Also is there a way to dynamically add elements to array when you edit input, perhaps type in text ?
for example:
Input
<div>
<input type="text" ng-model={{ filterArray.insert("bookname":"value") }}>Book Name
</div>
Filter
<div ng-repeat="books in originalJson | filter: filterArray">
{{books.author}}
</div>
I hope i have explained my question enough, cheers
where
. – vch Aug 18 '14 at 16:10