Created
March 15, 2015 07:59
-
-
Save wcc526/38f265b6f0127baa83b4 to your computer and use it in GitHub Desktop.
ng-class
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<section> | |
<p> | |
<p> | |
<span ng-class="{'label-success':focus}" class="label label-default">Focus!</span> | |
<span ng-class="{'label-warning':!focus}" class="label label-default">Blur!</span> | |
</p> | |
<input ng-model="title" class="form-control" ng-focus="focus=true" ng-blur="focus=false" placeholder="Enter a title for your book"/> | |
<div class="panel"> | |
<p> <h1> [[ focus ]]</h1> The title of your book is [[ title.length ? title : "No Name" ]] </p> | |
</div> | |
</p> | |
</section> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment