!DOCTYPE html>
<html>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script>
<body ng-app>
<style>
input.ng-invalid {
background-color:red;
}
input.ng-valid {
background-color:lightgreen;
}
</style>
<h3>enter a email:</h3>
<form name="myform">
<input type="email" name="myinput" ng-model="myvalue">
</form>
</body>
</html>In this code snippet you will learn how to use ng-valid and ng-invalid.
