Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

angular.copy not copying accessors (getters/setters) #5085

Closed
@chtulhu6662000

Description

@chtulhu6662000

It seems like angular.copy doesn't re-create accessors (getter/setter properties) when cloning, which leads to a break in behavior.

For instance:

    var template = {
        data: {label: 'new node'},

        get label() {return this.data.label;},
        set label(value) {  this.data.label = value;}
    };

    var test = angular.copy(template);
    test.label = 'not working';
    console.log(test.data.label); // Should be 'not working', but instead is 'new node'

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions