0 votes
in Angular by
How can you hide an HTML element just by a button click in angular?

1 Answer

0 votes
by

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.

View

<div ng-controller="MyController">

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

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

</div>

Controller

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. 

Related questions

+1 vote
asked Jul 5, 2021 in Angular by sharadyadav1986
0 votes
asked Feb 5, 2021 in Angular by SakshiSharma
...