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.

1.4.8: angular copy looses object type #13398

Closed
@slepkaviba

Description

@slepkaviba

When an object contains a property initialized with new String() it is not serialized properly into the string using JSON.stringify if angular.copy() was used on it. Example on plunkr:

http://plnkr.co/edit/QzHZcJExzbdynqwt8TWh?p=preview

So:

  var str = new String('test');
  var obj = {
    test: str
  };

  JSON.stringify(obj) !== JSON.stringify(angular.copy(obj));

I have checked with lodash clone and angular's extend, and there all seems fine.

Issue seems tricky in a way that ngOptions seems to .copy() values, so that instead of strings there, we are receiving map of letters in the model.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions