How to implement dirty checking on form elements using angularjs -
i want implement dirty check on required elements in form
i have tried this
<div ng-app=""> <form name="myform" ng-controller="ctrl"> <label> usertype: </label> <input name="usertype" ng-model="usertype" required> <span class="error" ng-show="myform.usertype.$dirty">required</span><br> <label> designation: </label> <input name="designation" ng-model="designation" required> <span class="error" ng-show="myform.designation.$dirty">required</span><br> </form> </div>
Comments
Post a Comment