You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.
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.
The text was updated successfully, but these errors were encountered:
This probably changed a bit after 33c67ce (will be in next 1.5 release). Now the destination object will be cleared correctly, but copying to it will fail in some cases (same cases as before the change).
This could be enhanced a bit to either a) throw an error when isArray(source) != isArray(destination) or b) allow copying from an array into object (just like object into array works today - which is kind of weird)...
after that, both
angular.copy([], obj)
andangular.copy({}, obj)
will not clear the properties ofobj
. 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.
The text was updated successfully, but these errors were encountered: