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.
1 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.
3 Comments
mike
can you give me an example
Mikkel
$( "#target" ).hide();
Nick Ribal
Or simply
document.getElementById('target').style.display = 'none'