##AngularJS ngModel and form animation
Created
August 2, 2015 15:41
-
-
Save anonymoussc/fdf9710cfe26b70a8243 to your computer and use it in GitHub Desktop.
AngularJS ngModel and form animation
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
<!DOCTYPE html> | |
<html ng-app="myApp"> | |
<head> | |
<title>ngModel and form animation</title> | |
<link href="style.css" rel="stylesheet"/> | |
</head> | |
<body> | |
<div> | |
<form> | |
<input ng-model="ngModelSample" ng-pattern="/^\d+$/" class="inputSample"/> | |
</form> | |
</div> | |
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.0/angular.min.js"></script> | |
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.0/angular-animate.min.js"></script> | |
<script src="script.js"></script> | |
</body> | |
</html> |
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
var app = angular.module('myApp', ['ngAnimate']); |
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
/* ngModel animation */ | |
.inputSample.ng-invalid-add { | |
-webkit-transition : 1s linear all; | |
-moz-transition : 1s linear all; | |
-o-transition : 1s linear all; | |
-ms-transition : 1s linear all; | |
transition : 1s linear all; | |
color : black; | |
} | |
.inputSample.ng-invalid { | |
color : red; | |
} | |
.inputSample.ng-invalid-add-active { | |
color : red; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment