Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

Commit

Permalink
Extend function fix
Browse files Browse the repository at this point in the history
Extend function of Angular blindly overwrites destination values even if source value is undefined. This fix allows "default" values to remain intact if new value is undefined.
  • Loading branch information
stsvilik committed May 16, 2013
1 parent 33c6738 commit 7bb5a0f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Angular.js
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,9 @@ function extend(dst) {
forEach(arguments, function(obj){
if (obj !== dst) {
forEach(obj, function(value, key){
dst[key] = value;
if(value !== undefined) {
dst[key] = value;
}
});
}
});
Expand Down

0 comments on commit 7bb5a0f

Please sign in to comment.