AngularJS Tutorial - ng-show with boolean constant








You can use ng-show with boolean constant.

Example


<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.13/angular.js"></script>
</head><!--from w w w.j  a  v a 2s  .  co  m-->
<body ng-app>
  <div ng-if="false">text</div>
  <div ng-show="false">text2</div>
  <div ng-if="true">text</div>
  <div ng-show="true">text2</div>
  
</body>
</html>

The code above is rendered as follows: