AngularJS Example

by gavinfoley

HTML

<div data-ng-app="">
  Click me: <input type="checkbox" data-ng-model="checked"><br/>
  Show: <span data-ng-show="checked">I show up when your checkbox is checked.</span> <br/>
  Hide: <span data-ng-hide="checked">I hide when your checkbox is checked.</span><br/><br/><br/>
  Click me: <input type="checkbox" data-ng-model="checked2"><br/>
  Show: <span data-ng-show="checked2">I show up when your checkbox is checked.</span> <br/>
  Hide: <span data-ng-hide="checked2">I hide when your checkbox is checked.</span>
</div>

CSS

</style> <!-- Ugly Hack due to jsFiddle issue: http://goo.gl/BUfGZ --> 
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.0.5/angular.min.js"></script>
<style>
​.ng-invalid { border: 1px solid red; }​