mike mike - 27 days ago 6
AngularJS Question

How to hide a div with it's id in angularJS?

Here i want to hide a div with id,is it possible in angularJS.I know it is possible to hide anything with

ng-hide
or
ng-show
.but i dont know how to hide a div with it's id.

Answer

You can use good old jquery to do that, but it's really preferable to avoid modifying the dom directly like that.

Using a scope variable give far more flexibility than modifying style attributes directly.

Use ng-if if you don't want the markup in the dom.

Comments