Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

AngularJS ; How to hide items in a list

Posted on 2015-01-06
4
Medium Priority
?
150 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

The task A number given should be formatted for easy reading by separating digits into triads. Format must be made inline via JavaScript, i.e., frameworks / functions are not welcome. So let’s take a number like this “12345678.91¿ and format i…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
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…

618 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