I have the following JSON:
[{
"IdModulo": 1,
"IdPadre": 0,
"Nombre": "Home",
"Ruta": "menu.home",
}, {
"IdModulo": 2,
"IdPadre": 0,
"Nombre": "Administrador",
"Ruta": "menu.administrador"
}, {
"IdModulo": 3,
"IdPadre": 0,
"Nombre": "Informes",
"Ruta": "menu.informes"
}, {
"IdModulo": 4,
"IdPadre": 2,
"Nombre": "Carga archivo",
"Ruta": "menu.administrador"
}, {
"IdModulo": 5,
"IdPadre": 2,
"Nombre": "Verificación",
"Ruta": "menu.verificacion"
}, {
"IdModulo": 6,
"IdPadre": 2,
"Nombre": "Procesados",
"Ruta": "menu.procesados"
}, {
"IdModulo": 7,
"IdPadre": 2,
"Nombre": "Hyperion",
"Ruta": "menu.hyperion"
}, {
"IdModulo": 10,
"IdPadre": 2,
"Nombre": "Clientes",
"Ruta": "menu.clientes"
}, {
"IdModulo": 8,
"IdPadre": 3,
"Nombre": "Reclasificaciones",
"Ruta": "menu.reclasificacion"
}, {
"IdModulo": 9,
"IdPadre": 3,
"Nombre": "Resumen",
"Ruta": "menu.resumen"
}]
Which I want to filter so that it only generates me those elements whose IdPadre = 0
.
I use this code to generate the elements with condition IdPadre = 0
:
<ul class="nav navbar-nav">
<li ng-repeat="menues in menu | filter: IdPadre = 0" ng-class="getClass('/{{menues.Nombre.toLowerCase()}}')" class="" ng-click="cargarItemsDelMenu(menues.IdModulo)">
<a ui-sref="{{menues.Ruta}}">
<span>{{menues.Nombre.toUpperCase()}}</span>
</a>
</li>
</ul>
But (in addition to the elements that fulfill the condition) brings me the element "Clients" - this one should not bring it, because its IdPadre = 2
.
What am I doing wrong and how do I successfully filter the values according to the filter?