rafbgarcia/angular-parse-wrapper — pull request #6 by taivo (2014-12-29 01:55:17+00:00)
Title: guard against bug when defaultValue is obj or array

When the specified defaultValue is specified as a javascript object or array, e.g., {} or [], our wrapped property will return the reference to that object/array. A user can then make intermediate modifications to our copy of this object/array and this copy will be shared with all other models of the same wrapped class.

Instead of returning a clone of defaultValue every time the get method is called (which makes angular scope digest mechanism go crazy), I saved at most 1 clone of the defaultValue per model per field and return that reference to the client when get() is invoked.