Understanding Form State Json

  • As we saw in the previous blog we are able to get ngForm when printed will provide us the json of all the form elements on which ngModel directive is applied on.
  • When we go in details with in this json we can see control object as key in the json which nested objects in it for each form element present in the form.
  • Now each form control object has a set of property example : dirty, disabled, enabled, touched,vallid and errors
  • Note when viewing the form dom we can see ng-dirty, ng-touched and ng-invalid/ng-valid directives in the form’s input tag

Leave a Comment