AngularJS ; How to hide items in a list

How can I hide the items in list that do not match the criteria?

I have a list of facts like

fact.name = 'ABC'
fact.name = 'XYZ'


My JSON LOOKS LIKE THIS

 {                      "NAME": "ABC"
                 
                  },

{                      "NAME": "XYZ"
                 
                  },

When I run this.. I get 2 items for each record, I only 1 to display .

Any ideas what is wrong?





    <ion-item ng-repeat="fact in facts" item="fact" ng-class="{{fact.name}}">
                                                   
                                  <!-- ABC -->
                                  <ion-item class="ABC">
                                    <div class="item-header">
                                        <div class="item-header-type-icon">
                                            <i class='icon ion-clipboard'></i>
                                        </div>
                                     
                                    </div>

                                 </ion-item>

                                <!-- XYZ -->
                                <ion-item class="XYZ">
                                    <div class="item-header">
                                        <div class="item-header-type-icon">
                                            <i class='icon ion-cube'></i>
                                        </div>
                                 
                                    </div>
LVL 1
JElsterAsked:
Who is Participating?
 
JElsterConnect With a Mentor Author Commented:
used ng-switch
0
 
Alexandre SimõesConnect With a Mentor Manager / Technology SpecialistCommented:
What criteria?

That's the code of your ng-repeat or the generated one?
0
 
JElsterAuthor Commented:
it's just markup

   <ion-item ng-repeat="fact in facts" item="fact" ng-class="{{fact.name}}">

for each record I get 2 items
0
 
JElsterAuthor Commented:
found my own solution
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.