NgShow Example

Angular JS

by Felipe Santos

HTML

<script src="https://code.angularjs.org/angular-1.0.1.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
<div class="container" ng-app="showApp" ng-controller="mainController">

    <div class="page-header text-center">
       <h1>ngHide</h1>
    </div>

    <div class="row">
      <div class="col-md-12">
        <h2 ng-hide="ocultar">O angularJS é muito prático!</h2>
        <input type="checkbox" ng-model="ocultar"> Clique no botão para ocultar/exibir o texto.
      </div>
      
    
    </div>

CSS

.red{ background: red; width: 30px; height: 30px; }
.blue{ background: blue; width: 30px; height: 30px; }
.green{ background: green; width: 30px; height: 30px; }
.yellow{ background: yellow; width: 30px; height: 30px; }
.pink{ background: pink; width: 30px; height: 30px; }

JavaScript

var showApp = angular.module('showApp', [])

.controller('mainController', function($scope) {

});