FootsieNG FootsieNG - 1 year ago 70
AngularJS Question

ng-show disturbing div layout - angularJS

I am using

to hide a div if the notesOpened variable is true. However when hidden it messes up layout. Is there a way to make ng-show act in the same way as the css property
? so that all div elements around the div being hidden stay in the same place

Answer Source

ng-hide uses the same property that you're referring to, i.e. display: none.

If you need to achieve this, you need to use visibility: hidden;

For that you can use the ng-class attribute.

eg: ng-class="{'vis-hidden': notesOpened==true}"

     visibility: hidden;
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download