мой объект:
objects = [
{
name: "1",
foo: [{
value: 0.5,
ignored: null,
text: "foo1"
}, {
value: 0,
ignored: null,
text: "foo"
}]
},
{
name: "2",
foo: [{
value: 0,
ignored: null,
text: "foo"
}, {
value: 0.5,
ignored: null,
text: "foo2"
}]
},
{
name: "3",
foo: [{
value: 0.5,
ignored: null,
text: "foo3"
}]
},
{
name: "4",
foo: [{
value: 0,
ignored: 1,
text: "foo4"
}]
},
{
name: "5",
foo: [{
value: 0,
ignored: null,
text: "foo5"
}]
}]
мой шаблон AngularJs html:
<div class="row" ng-repeat="object in objects">
{{ object.name }}
<div ng-repeat="foo in object.foo">
<div ng-if="foo.value > 0 || foo.ignored == 1">
{{ foo.text }}
</div>
</div>
</div>
Мой результат:
1 foo1
2 foo2
3 foo3
4 foo4
5
, но я не хочу отображать object.name
для случая № 5 *. 1011 *
Как использовать 2-е ng-repeat
и ng-if
в 1-м ng-repeat
, пожалуйста?
<div class="row" ng-repeat="object in objects" ng-if="...???...">
{{ object.name }}
any text !!
</div>