-
Notifications
You must be signed in to change notification settings - Fork 27.4k
Updated angular extend to ignore undefined properties #8387
base: master
Are you sure you want to change the base?
Conversation
I'm sorry, but I wasn't able to verify your Contributor License Agreement (CLA) signature. CLA signature is required for any code contributions to AngularJS. Please sign our CLA and ensure that the CLA signature email address and the email address in this PR's commits match. If you signed the CLA as a corporation, please let us know the company's name. Thanks a bunch! PS: If you signed the CLA in the past then most likely the email addresses don't match. Please sign the CLA again or update the email address in the commit of this PR. |
CLA signature verified! Thank you! Someone from the team will now triage your PR and it will be processed based on the determined priority (doc updates and fixes with tests are prioritized over other changes). |
Updated angular.extend functionality: - omit undefined properties in source objects - allow null properties to be copied
@martynasb - can you give a use case where this was a problem for you. It would be great to keep |
@petebacondarwin Sure. I was working on a project that involves map visualizations. A map has certain settings: width, height, tile provider, etc. A developer has an option of setting these options himself to override the defaults. For example: We get the default settings: Then get the user options: // Merge them: I had to use jQuery's $.extend() because ignores undefined values. I hope this makes sense |
02dc2aa
to
fd2d6c0
Compare
cad9560
to
f294244
Compare
e8dc429
to
e83fab9
Compare
4dd5a20
to
998c61c
Compare
Updated angular.extend to ignore undefined properties.