Tutorial 12 – How to use ng-show and ng-hide in AngularJS

How to use ng-show and ng-hide in AngularJS
This sample will help you know about using ng-show and ng-hide in AngularJS.


 <html>  
   <head>  
     <title>Angular JS Model</title>  
     <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.15/angular.min.js"></script>  
     <script>  
       angular.module('MyForm', [])  
           .controller('myController', ['$scope', function($scope) {  
             }]);  
     </script>  
   </head>  
   <body ng-app="MyForm">  
 <h3>Directive ng-show and ng-hide in AngularJS</h3> <br />  
           <h5>Click to show/hide </h5>  
           <input type="checkbox" ng-model="o_checkbox"> Check to show <br />  
           <div>  
             <div ng-show="o_checkbox">  
               I'm here  
             </div>  
           </div>  
           <input type="checkbox" ng-model="o_checkboxhide"> Check to hide<br />  
           <div>  
             <div ng-hide="o_checkboxhide">  
               I'm ready  
             </div>  
           </div>  
  </body>  
 </html> 
 
Thanks for reading the article "How to use ng-show and ng-hide in AngularJS" 


No comments:

Post a Comment

Popular Posts