Questions tagged [angularjs-ng-show]

The ngShow directive shows or hides the given HTML element based on the expression provided to the ngShow attribute.

From Angularjs documentation:

The ngShow directive shows or hides the given HTML element based on the expression provided to the ngShow attribute. The element is shown or hidden by removing or adding the .ng-hide CSS class onto the element. The .ng-hide CSS class is predefined in AngularJS and sets the display style to none (using an !important flag). For CSP mode please add angular-csp.css to your html file (see ngCsp).

171 questions
3
votes
2 answers

When to use ng-if vs ng-show/ng-hide?

I understand that ng-show and ng-hide affect the class set on an element and that ng-if controls whether an element is rendered as part of the DOM Are there any examples on choosing ng-if over ng-show/ng-hide or vice-versa?
Anil kumar
  • 930
  • 7
  • 18
3
votes
3 answers

angularjs show/hide tabs, click same tab hide the content

when i click tab A, A content show when i click tab B, A content hide B content show but the effect i want is when i click tab A, A content show, click A tab again content hide. Any suggest will be help thanks
3
votes
2 answers

Method display on the scope is not executed

I have a set of directives that share a scope Update: The code is available as a plunk here http://plnkr.co/edit/JZ77bsZgGrw6N4K718Is?p=preview todo-item: app.directive("todoItem",function(DeleteTodo,$log){ var dirDefObj = { restrict:'E', …
3
votes
2 answers

ngShow not working from a template on HTML

I have a problem to show and hide a div from a template on HTML page. here is a simple JSFiddle example Example. app.directive('example', function () { return { restrict: 'E', template: '
Ayyoub
  • 1,315
  • 1
  • 16
  • 37
3
votes
3 answers

ng-show is blinking with angular 1.3.6 in safari

I develop a mobile web app with Ionic Framework. When I was using ionic beta-13 with angular 1.3.0, the ng-show worked fine. But after the update to ionic beta-14 with angular 1.3.6, on Safari browser the element started to blink when I navigate…
leonprou
  • 4,638
  • 3
  • 21
  • 27
3
votes
3 answers

ng-show and ng-if lags to hide content

I have the following in to show and hide the clear button based upon if the searchQuery is empty or not. When a user starts typing in the input box, the button shows instantly. However, when the user either clicks the clear button or deletes all…
robert
  • 819
  • 1
  • 10
  • 24
3
votes
0 answers

ng-show not working after boolean change

I have an ng-click in my navbar to change the boolean and show my div. When I click it, the boolean changes, but the ng-show doesnt respond. This html is in my layout file while the controller I'm working with is in my body html file. when i put…
alankalter
  • 31
  • 4
3
votes
1 answer

Why doesn't Angular update the ng-show status when I use an expression?

I have no problem getting ng-show to work when I use a scoped variable: (excerpt from html file:)
  • Battery
    Type
    {{phone.battery.type}}
  • using the following…
    2
    votes
    1 answer

    Angular. How to hide data in the title attribute of the image if the object value is null?

    I understand ng-show/ng-hide can be used but this case is a little different. This is my script below. Basically what I'm trying to do is hide the word "PEAK" if 'info.peak' value is empty in the title tag. DO I need to create two versions of this…
    2
    votes
    3 answers

    Angular not clearing text input

    I want to hide a div based on a click from a controller : My HTML :

    {{emp.name}}

    Somename
    • 3,376
    • 16
    • 42
    • 84
    2
    votes
    1 answer

    Handing ng-repeat and ng-if for dynamic datas from server

    I have a social media icons where I enable(turns reds color) like button only if my item.like== 1or it wont be highlighted (will be in white color)when item.userid==0. I am doing this dynamically.so I need to call the function profileData () again…
    2
    votes
    3 answers

    AngularJS ng-show not working with $timeout?

    I want to selected tab and showing 2 buttons. so this is my aspx code :
    2
    votes
    3 answers

    How can i use values from ng-model for ng-show?

    i'm a newb in angular and have some trouble to figure out how to use the values from ng-model in the correct way. I made two drop-down lists and want to create a dependence between these two. The second list shall be displayed, depending on the user…
    2
    votes
    2 answers

    Angular ng-show does not check the condition continuously?

    I have an ng-repeat directive where i show all the objects (ideas). If an idea description (string) is longer than x, i want to display only the first x charachters and a "show all" link. User can click on this link, and the whole text will be…
    akcasoy
    • 6,497
    • 13
    • 56
    • 100
    2
    votes
    2 answers

    When Ng-click do ng-show on the clicked element in a ng-repeat

    I am trying to have a element show certain text during a load. The issue that I run into is the elements are repeated in the ng-repeat. When I click on one they all switch vs. just that element. I am not sure how to just target one.
    1
    2
    3
    11 12