Question:What directives are used to show and hide HTML elements in AngularJS? 

Answer ng-show and ng-hide directives are used to show and hide HTML elements in the AngularJS based on an expression. When the expression is true for ng-show or ng-hide, HTML element(s) are shown or hidden from the page. When the expression is false for ng-show or ng-hide, HTML element(s) are hidden or shown on the page.
<div ng-controller="MyCtrl"> 
  <div ng-show="data.isShow">ng-show Visible</div> 
  <div ng-hide="data.isHide">ng-hide Invisible</div> 
</div>
<script> 
 var app = angular.module("app", []);
 app.controller("MyCtrl", function ($scope) { 
   $scope.data = {};
   $scope.data.isShow = true; 
   $scope.data.isHide = true; 
}); 
</script>
 

+ Report
Total Preview: 1008
What directives are used to show and hide HTML elements in AngularJS?
Copyright © 2024. Powered by Intellect Software Ltd
  ","http://vcampusbd.com/answers/19157/what-directives-are-used-to-show-and-hide-html-elements-in-angularjs","http://vcampusbd.com/images/vcampus_quiz.jpg","AngularJS"); }); });