Jak filtrować dane JSON za pomocą AngularJs?
Mam tablicę (_users) zawierającą obiekty JSON.
{
"User":
{
"userid":"19571",
"status":"7",
"active":"1",
"lastlogin":"1339759025307",
"Stats":
[
{
"active":"1",
"catid":"10918",
"typeid":"71",
"Credits":
[
{
"content":"917,65",
"active":"1",
"type":"C7"
},
{
"content":"125,65",
"active":"1",
"type":"B2"
}
]
}
]
}
}
1- Jak mogę filtrować tylko użytkowników z „aktywnym”: „1”, a nie „0”
Próbowałem czegoś takiego:
<div ng-repeat="user in _users | filter:active | orderBy:user.userid">
{{user.userid}}
</div>
ale dla mnie nie działa poprawnie.
Dziękuję Ci!