Why is this though? Is there a rationale behind NOT preserving object type 
and prototypes?

On Saturday, May 18, 2013 3:54:52 AM UTC+1, Raymond Z. wrote:
>
> Yes, angular.copy (link to source 
> definition<https://github.com/angular/angular.js/blob/master/src/Angular.js#L591>)
>  
> only copies the key-value pairs of the Object you pass in. So angular.copy 
> doesn't just flatten the prototype chain, it ignores it completely.
>
> Though it has the Dog constructor, that Dog copy is just an Object. It 
> does not have Animal or Dog in its prototype chain (hence the __proto__: 
> Object, instead of __proto__: Animal). See this example code: 
> http://jsfiddle.net/razh/bE5Va/
>

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to