Solved

AngularJS ; How to hide items in a list

Posted on 2015-01-06
4
139 Views
Last Modified: 2015-01-13
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>
0
Comment
Question by:JElster
  • 3
4 Comments
 
LVL 30

Assisted Solution

by:Alexandre Simões
Alexandre Simões earned 500 total points
ID: 40533911
What criteria?

That's the code of your ng-repeat or the generated one?
0
 
LVL 1

Author Comment

by:JElster
ID: 40533980
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
 
LVL 1

Accepted Solution

by:
JElster earned 0 total points
ID: 40538745
used ng-switch
0
 
LVL 1

Author Closing Comment

by:JElster
ID: 40546256
found my own solution
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now