Jan 15, 2020 in Angular
Q: How can you hide an HTML element just by a button click in angular?

1 Answer

0 votes
Jan 15, 2020

An HTML element can be easily hidden using the ng-hide directive in conjunction along with a controller to hide an HTML element on button click.


<div ng-controller="MyController">

  <button ng-click="hide()">Hide element</button>

  <p ng-hide="isHide">Hello World!</p>



controller: function() {

this.isHide = false;

this.hide = function(){

this.isHide = true; }; }

So this brings us to the end of the Angular interview questions article. The topics that you learned in this Angular Interview Questions article are the most sought-after skill sets that recruiters look for in an Angular Professional. These set of Angular Interview Questions will definitely help you ace your job interview. Good luck with your interview!

If you found this “Angular Interview Questions” relevant, check out the Angular Certification Training by Edureka, a trusted online learning company with a network of more than 250,000 satisfied learners spread across the globe. 

Click here to read more about Angular JS
Click here to read more about Insurance

Related questions