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
Description
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.