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([], obj) will make obj un-clear-able #13193
Closed
Description
var arr = []; // got from php like: json_encode(array())
var obj = {};
angular.copy(arr, obj);
after that, both angular.copy([], obj)
and angular.copy({}, obj)
will not clear the properties of obj
. I know that the doc says the destination object should be same type as the source object, but there is no check on that.
It'll be good for debugging if an error would be thrown when the types dose not match.