ngModel.NgModelController.$render()

$render();

Called when the view needs to be updated. It is expected that the user of the ng-model directive will implement this method.

The $render() method is invoked in the following situations:

  • $rollbackViewValue() is called. If we are rolling back the view value to the last committed value then $render() is called to update the input control.
  • The value referenced by ng-model is changed programmatically and both the $modelValue and the $viewValue are different from last time.

Since ng-model does not do a deep watch, $render() is only invoked if the values of $modelValue and $viewValue are actually different from their previous values. If $modelValue or $viewValue are objects (rather than a string or number) then $render() will not be invoked if you only change a property on the objects.

doc_AngularJS
2016-03-29 16:12:15
Comments
Leave a Comment

Please login to continue.