Rolling back changes in Angular

You can use $rollbackViewValue to roll back an input value to the model Value.

Thiss is also useful for updating the view if the model chaned behind the scenes and need to update the view accordingly.

You can rollback through the form name. for example:

editForm.$rollbackViewValue()

or you can rollback the view value for each control :

function () { 
forEach(controls, function(control) {
control.$rollbackViewValue();
});
}
Like what you read? Give Tal Avissar a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.