Skip to content

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

Closed
@icxDave

Description

@icxDave

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions