?
Solved

AngularJS ; How to hide items in a list

Posted on 2015-01-06
4
Medium Priority
?
148 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 30

Assisted Solution

by:Alexandre Simões
Alexandre Simões earned 2000 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
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…
Suggested Courses

765 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