Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Thread Contributor: Ravishankar ChavarePart 6.6-ng-hide & ng-show Directives
#1
ng-hide & ng-show Directives:

-Hide and show the html element.
-ng-show directive shows or hides the given html element based on the expression provided to the ng-show attribute.


Example:
Code:
<!DOCTYPE html>
    <html ng-app="" >
    <head>
    <title></title>
    <script src="angular.min.js"></script>

    </head>
    <body>
    hide<input type="checkbox" ng-model="myMode">
    <div ng-hide="myMode">
    <h1>Hidden text here</h1>
    </div>
    </body>
</html>


OUTPUT WHEN PAGE LOADED:

[Image: XsRSEyN.png]



OUTPUT WHEN CHECK BOX SELECTED:

[Image: lTadryS.png]
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)