3

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 1

3

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.

Sign up to request clarification or add additional context in comments.

3 Comments

can you give me an example
$( "#target" ).hide();
Or simply document.getElementById('target').style.display = 'none'

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.