简体   繁体   中英

How to filter with angularJS value from JSON

Hi guys i need a quick response, sorry for my lack of english but here is the problem:

I'm doing ng-repeat on a JSON object i recieve from the API. The object has listin it etc. and the Json object has PLACE value. Place is a int that gives me the position where to put the object, and how to put it in a LIST!

so i do the ng-repeat="s in object" and now i need the s.PLACE value to Filter the objects. How do i do that?

  <div class="some class" ng-repeat="s in Object| limitTo:6:0 ">
<li>{{s.Name}}</li>
</div>

example, just how mI supposed to tell him, IF PLACE IS == 1 SKIP don ng-Repeat item, or when PLACE==2 put it in the last place. Is this possible with ng-repeat?

 <div class="some class" ng-repeat="s in Object| limitTo:6:0 ">
<li ng-if="s.PLACE > 1">{{s.Name}}</li>
</div>

So i found out i can use ng-if for stuff like this!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM