<!DOCTYPE html>
<html>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script>
<style>
textarea.ng-invalid {
background-color:pink;
}
textarea.ng-valid {
background-color:lightgreen;
}
</style>
<body ng-app="">
<p>Try writing in the textarea field:</p>
<textarea ng-model="myName" required>
The textarea requires content, and will therefore become green when you write in it.