The code below seems to work pretty well for doing basic required form validation.
The form displays a red Name is required message when the field is dirty
Please use this CSS
.myForm input.ng-invalid.ng-dirty { background-color: #FA787E; } .myForm input.ng-valid.ng-dirty { background-color: #78FA89; }