D
D
Deliaz2014-09-11 17:40:56
JavaScript
Deliaz, 2014-09-11 17:40:56

How to hide some object keys on ngRepeat?

Hello.
I have a big object.
I take it out like this:

<div ng-repeat="(key, val) in obj">
  <span class="text-success">{{key}}:</span>
  <span>{{val}}</span>
</div>
At the same time, there is a row (about 10 pieces) of key's that do not need to be displayed.
How to exclude them?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey, 2014-09-11
@Deliaz

either do ng-repeat for those keys that should be displayed and access the object, or through ngIf skip elements with keys to the black list. And even better - filter the keys when writing to the scope.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question