Skip to content

Error: [ng:cpws] Can't copy! Making copies of Window or Scope instances is not supported. #849

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
icxDave opened this issue Mar 2, 2017 · 2 comments

Comments

@icxDave
Copy link

icxDave commented Mar 2, 2017

Error: [ng:cpws] Can't copy! Making copies of Window or Scope instances is not supported.
When upgrading to Angular 1.6.0+, upon
$scope.$broadcast('schemaFormValidate');

there is an error with angular 1.6.0+ that will prevent the $$scope from when Angular copies the element/ng-model:

Stack Trace:
screen shot 2017-03-01 at 7 09 12 pm

Angular is copying the element based on the stack track:
screen shot 2017-03-01 at 7 11 07 pm

Here is a snippet of what the object looks like - which includes $$scope.
screen shot 2017-03-01 at 9 34 28 pm

I've tried modifying the $$scope that's to be copied but it breaks when it needs the $watchers or $evalAsSync in later operations.

WIth 1.6.0 Angular - it's checking for the below to ensure we aren't copying Window or $scope.

function isWindow(obj) {
  return obj && obj.window === obj;
}

function isScope(obj) {
  return obj && obj.$evalAsync && obj.$watch;
}

I've tried searching for someone that has run into this issue but haven't seen any posts yet for it.

@json-schema-form/angular-schema-form-lead

@Anthropic
Copy link
Member

Anthropic commented Mar 3, 2017

@icxDave thanks for letting me know, it looks like it may be a bug in 1.6 to be fixed in 1.6.1 based on reading this: angular/angular.js#15479

Could you try their solution and let me know if it fixes this or not?

@Anthropic
Copy link
Member

@icxDave any luck with the proposed solution?

I'm going to close this unless/until someone confirms this isn't an Angular bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants