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.merge() fails on scope merge #12653
Closed
Description
When performing angular.merge() on an object containing a $scope it fails with
"RangeError: Maximum call stack size exceeded"
.Merge() is attempting to deep copy the scope. Which just doesn't work. Angular.copy() states that copying states is not supported.
I was going to submit a PR but i'm not quite sure what the behavior should be. Should it just set a reference to the scope on the new object? (this is what I, as a user, would prefer) or skip it? Whatever it is I don't think it should throw an exception
CodePen:
http://codepen.io/anon/pen/eNwxYj
This has been handled with Dates and RegExp in the following issues:
#12409 #11974 #11720 #10519