Created
September 1, 2014 20:00
-
-
Save ZeroDragon/5a8601346155e01483fa to your computer and use it in GitHub Desktop.
a demo
This file contains hidden or 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
<!doctype html> | |
<html ng-app> | |
<head> | |
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.12/angular.min.js"></script> | |
</head> | |
<body> | |
<div> | |
<label>Name:</label> | |
<input type="text" ng-model="yourName" placeholder="Enter a name here"> | |
<hr> | |
<h1>Hello {{yourName}}!</h1> | |
<div ng-show="(140 - yourName.length)>=20"> | |
{{140 - yourName.length}} | |
</div> | |
<div class="dred" ng-show="(140 - yourName.length)<20 && (140 - yourName.length)>=10"> | |
{{140 - yourName.length}} | |
</div> | |
<div class="red" ng-show="(140 - yourName.length)<10"> | |
{{140 - yourName.length}} | |
</div> | |
<div ng-class="((140 - yourName.length) < 20 ) ? 'dred' : ( ( (140 - yourName.length) < 10) ? 'red' : 'black' )"> | |
COLORES | |
</div> | |
</div> | |
</body> | |
<style> | |
.dred{color:#a00;} | |
.red{color:#f00;} | |
.black{color:#000;} | |
</style> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment