Unintended breaking change when passing ngModel as a binding #15833
Description
Note: for support questions, please use one of these channels: https://github.com/angular/angular.js/blob/master/CONTRIBUTING.md#question. This repository's issues are reserved for feature requests and bug reports.
Do you want to request a feature or report a bug?
bug
What is the current behavior?
The following code throws an error with AngularJS 1.6.2 but not with 1.5.8 (I haven't checked other versions yet):
<form name="example">
<input name="example[firstName]" ng-model="firstName">
<validation-confirmed fields="[example['example[firstName]']]"></validation-confirmed>
</form>
The error:
Error: [ng:cpws] Can't copy! Making copies of Window or Scope instances is not supported.
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via https://plnkr.co or similar (template: http://plnkr.co/edit/tpl:yBpEi4).
Reproduce:
https://plnkr.co/edit/dAqZuQP4e9Gk1wc6c1sw?p=preview (AngularJS 1.6.2 not working)
https://plnkr.co/edit/nuXCMcYoJUGJ4xucmhqC?p=preview (AngularJS 1.5.8 working)
What is the expected behavior?
No error as in the 1.5.x version.
What is the motivation / use case for changing the behavior?
Which versions of AngularJS, and which browser / OS are affected by this issue? Did this work in previous versions of AngularJS? Please also test with the latest stable and snapshot (https://code.angularjs.org/snapshot/) versions.
Other information (e.g. stacktraces, related issues, suggestions how to fix)