angular.js icon indicating copy to clipboard operation
angular.js copied to clipboard

feat(ngModel): pass the previous and current model to view change listeners

Open luaks opened this issue 11 years ago • 3 comments

luaks avatar Oct 22 '15 09:10 luaks

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project, in which case you'll need to sign a Contributor License Agreement (CLA).

:memo: Please visit https://cla.developers.google.com/ to sign.

Once you've signed, please reply here (e.g. I signed it!) and we'll verify. Thanks.


  • If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check your existing CLA data and verify that your email is set on your git commits.
  • If you signed the CLA as a corporation, please let us know the company's name.

googlebot avatar Oct 22 '15 09:10 googlebot

Technically, when ngChange is called, the model should always have been changed. What's your use case for this?

Narretz avatar Nov 13 '15 15:11 Narretz

We are using this, to compare the old and new values of the form elements.

When autosaving we build a model from the valid values to be sent to the server, but want to keep the possibly invalid new value, for the user to still be editable, even if they leave the invalid field.

luaks avatar Nov 13 '15 16:11 luaks