In this post we will study ng-show directive in angular JS. ng- show directive is used to make HTML elements visible. Let us see this with the help of an example.
Write the following HTML mark up in the webpage.
- <!doctype html>
- <html ng-app>
- <head>
- <title>My Angular App</title>
- <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js"></script>
- </head>
- <body>
- <div ng-app="">
- <p ng-show="true">This text is visible.</p>
- <p ng-show="false">This text is not visible.</p>
- </div>
- </body>
- </html>

This is how we can use ng-show directive in AngularJS. I hope this post was useful to beginners.

Join the conversation! Your thoughts help the community grow.