Questions tagged [ng-hide]

The ngHide directive shows or hides the given HTML element based on the expression provided to the ngHide 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).

The ngHide directive shows or hides the given HTML element based on the expression provided to the ngHide 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 and sets the display style to none (using an !important flag).

See the AngularJS documentation for more information.

216 questions
1
vote
0 answers

How do include jQuery in ng-bind-html correctly? (will not ng-hide)

I'm having trouble with this situation: I have a block of jQuery code that I need to load using ng-bind-html into a span element. This element only get shown when a tab is selected so the span is doing ng-show="activetab===2" So I stick the jQuery…
Cocorico
  • 2,319
  • 3
  • 22
  • 31
1
vote
2 answers

Best way to clear model values when the field is hidden in angular

Below is some code to clear angular model values when the corresponding input to the model is hidden via ng-show, using classnames and jquery, but it has a bad smell bc it manipulates DOM in controller (Edit- it doesn't manipulate the DOM it changes…
gabriel
  • 326
  • 1
  • 2
  • 12
1
vote
1 answer

Hide/Show rows using tick button in ngGrid table (AngularJS)

it may be asked by someone before, but I checked Q&As and could not find the relevant answer for my question. So I am using an ng-grid table, which displays more than 30K data on that table. The data that I display is coming from the server, it is a…
Mammadj
  • 153
  • 2
  • 8
1
vote
1 answer

How to show or hide a div in Angular Js

I have implemented two div where i have used some drop down control in a div named as div1 .I want to hide div2 until the any value is selected in drop down.I want to know how to hide or show a div on ng-change or untill any value is selected div2…
Shian JA
  • 848
  • 4
  • 15
  • 52
1
vote
1 answer

ng-hide ng-show not working as it should

I am building a quiz in angular and Im trying to show a button based on whether the quiz has started. User go to their users page when logged in, and when they havent started the quiz i want to show the "start quiz" button. During the quiz they can…
idontknow
  • 966
  • 8
  • 21
1
vote
1 answer

Greater-than sign throws error in ng-hide

I have a very simple angularjs-code:
xxxxxxxxx
Returns the error: Uncaught Error: Syntax error, unrecognized expression: div[ng-hide='foo bc.error @ browserLink:37 bh @ browserLink:37bp ... foo is a number with a…
user1702269
1
vote
1 answer

ng-show in this sample not working

What I want is to show a DIV when I click a button and hide it after 2s.
{{alertMsg.text}}
After triggering the click event, the DIV shows correctly, but cannot hide. It seems that the value of "alertMsg.show" has…
Wowfeng
  • 17
  • 5
1
vote
1 answer

How to display only the results of hidden list using angular.js

I'm new to Angular.js and have a bit of a problem. I have a list that is searchable by a local scope variable. However, I DO NOT want to display the list which by default is displayed just below the input field. I only want to display results of the…
1
vote
2 answers

ng-hide or ng-show does not work if its controlled from within a ng-repeat

I am trying to hide the div if any of the buttons in the ng-repeat is clicked. However it doesn't seem to work, it leads me to think if ng-hide or ng-show won't work if it is controlled from within a ng-repeat?
Oh Chin Boon
  • 23,028
  • 51
  • 143
  • 215
1
vote
1 answer

ng-show and ng-hide with jwt

I'm managing authentication with JWT. I'm trying to use ng-hide and ng-show to show/hide login and logout buttons in my nav. It's not working. The token is being stored, but I'm unable to get the show/hide to work.…
1
vote
2 answers

Angular JS use NG-Hide with function

I try to create an Angular JS function that is displaying or hiding a Div in case that a certain requirement is met. I do have the problem now that the function is not properly called and both divs are either visible or not visible (In the test case…
nja
  • 571
  • 1
  • 7
  • 15
1
vote
1 answer

AngularJS - Converitng a string to int

I have JSON file with a list of strings that contain numbers, e.g { "MyAccount": "105" } On the front end, can i perform a condition on this value? ie:
//code ig account greater than 100
Trying to do…
Oam Psy
  • 8,555
  • 32
  • 93
  • 157
1
vote
4 answers

Angular - Filter to remove blank strings from array

I have an object of arrays... The array can contain blanks, how can i create an ANgular filter to remove the blanks to determine the length of the array? $scope.myData = { ["1", "1", "4", "4", "N", "4", "6", "8", "", "", "", "", "", "", "", "",…
Oam Psy
  • 8,555
  • 32
  • 93
  • 157
1
vote
2 answers

ng hide, how to conditionally show something in angular with url extension

I am testing and app and would like to do something very simple. I would like to hide a div and only show it in the browser when an extension is added to the url. For example:
meztli
  • 449
  • 2
  • 9
  • 20
1
vote
1 answer

Angular ngAnimate how to hide element after ngHide animation?

Currently when an element is hidden via ng-hide, first the element gets display="none" then the animation happens. Is there a way for display="none" to be added once the animation is finished?
azium
  • 20,056
  • 7
  • 57
  • 79