VOOZH about

URL: https://www.geeksforgeeks.org/angular-js/angularjs-ng-hide-directive/

⇱ AngularJS ng-hide Directive - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

AngularJS ng-hide Directive

Last Updated : 3 Aug, 2022

The ng-hide Directive in AngluarJS is used to show or hide the specified HTML element. If the expression given in the ng-hide attribute is true then the HTML elements hide. In AngularJS there is a predefined class named ng-hide which is used to set the display to none. 

Syntax:

<element ng-hide="expression"> 
 Contents... 
</element>

Parameter:

  • expression: It specifies the element will be hidden if the expression returns true.

Example 1: This example uses the ng-hide Directive to display whether the entered number is a multiple of 5 or not.

Output:

👁 Image
 

Example 2: This example uses the ng-hide Directive to hide content.

Output:

👁 Image
 
Comment

Explore