When trying to copy an object with AngularJS’ copy() it might be that Angular throws a RangeError. This is the case if your object has circular dependencies which is troublesome with creating an angular deep copy.

… you can easily fix the issue by using jQlite/jQuery’s extend(). This works perfectly with both, shallow and deep copies. Shallow copies duplicate as little as possible so you’d be better with omitting extend‘s first parameter.