Solved

AngularJS ; How to hide items in a list

Posted on 2015-01-06
4
137 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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
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…

744 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

12 Experts available now in Live!

Get 1:1 Help Now