javascript - $dirty with ng-model-options = { updateOn : 'blur' } -
<form name="angform" novalidate> <div class="form-group"> <label for="name1" class="sr-only">last name</label> <span ng-show="angform.name1.$dirty">* updated model after text box blurred. </span> <input type="text" name="name1" id="name1" class="form-control" ng-model="person.lastname" ng-model-options="{updateon : 'blur'}" ng-disabled="!edit" placeholder="last name" /> </div> </form>
the above code have text box span message, expect appear once user interacts (i.e., types) text box, model must updated view value when user leaves text box.
but, span message not displaying interaction happens, gets displayed when user leaves text box.
can please explain me behaviour?
Comments
Post a Comment