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

Use source object prototype in object copy #7846

Closed
wants to merge 2 commits into from
Closed

Use source object prototype in object copy #7846

wants to merge 2 commits into from

Conversation

myitcv
Copy link
Contributor

@myitcv myitcv commented Jun 16, 2014

Whilst not strictly necessary for the likes of $watch to behave as expected, given that angular.copy is exposed it should honour the prototype of the source object such that, as the test ensures:

function A() {}
var a = new A();
var a_copy = angular.copy(a);
expect(a_copy instanceof A).toBe(true);

Otherwise users of angular.copy (read: at least me) end up having to create their own version of angular.copy to make this one change.

@lgalfaso
Copy link
Contributor

Thanks for the PR, but it looks like this issue is a duplicate of #5063 I am closing it now but feel free to open in case there are other issues not included in the other PR

@lgalfaso lgalfaso closed this Jun 16, 2014
@lgalfaso lgalfaso removed their assignment Jun 16, 2014
@myitcv
Copy link
Contributor Author

myitcv commented Jun 16, 2014

@lgalfaso - apologies, I did search before posting (forget the search term I used) but clearly my search was bad... Thanks for finding the dup.

@lgalfaso
Copy link
Contributor

@myitcv it is not a problem

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants