diff options
| author | Thomas Belin | 2014-01-07 16:09:37 +0100 | 
|---|---|---|
| committer | Caitlin Potter | 2014-02-04 10:51:24 -0500 | 
| commit | d2e4e499862aeca157dbe7a7422c465e7c79205e (patch) | |
| tree | 6e2db182655371c002ac3ef4601d3023917e5dc8 /src | |
| parent | 0da6cc91186a04b089994293c0dfcda11851dd2d (diff) | |
| download | angular.js-d2e4e499862aeca157dbe7a7422c465e7c79205e.tar.bz2 | |
fix(ngResource): don't filter "$"-prefixed properties from ngResource requests/responses
ngResource no longer filters properties prefixed with a single "$" character from requests or
responses, correcting a regression introduced in 1.2.6 (cb29632a) which caused shallowCopy and
shallowClearAndCopy to ignore properties prefixed with a single "$".
Closes #5666
Closes #6080
Closes #6033
Diffstat (limited to 'src')
| -rw-r--r-- | src/Angular.js | 2 | ||||
| -rw-r--r-- | src/ngResource/resource.js | 2 | 
2 files changed, 2 insertions, 2 deletions
| diff --git a/src/Angular.js b/src/Angular.js index 21ce1ff7..8e315fb7 100644 --- a/src/Angular.js +++ b/src/Angular.js @@ -772,7 +772,7 @@ function shallowCopy(src, dst) {    for(var key in src) {      // shallowCopy is only ever called by $compile nodeLinkFn, which has control over src      // so we don't need to worry about using our custom hasOwnProperty here -    if (src.hasOwnProperty(key) && key.charAt(0) !== '$' && key.charAt(1) !== '$') { +    if (src.hasOwnProperty(key) && !(key.charAt(0) === '$' && key.charAt(1) === '$')) {        dst[key] = src[key];      }    } diff --git a/src/ngResource/resource.js b/src/ngResource/resource.js index 055f0890..1ab31bf5 100644 --- a/src/ngResource/resource.js +++ b/src/ngResource/resource.js @@ -35,7 +35,7 @@ function shallowClearAndCopy(src, dst) {    });    for (var key in src) { -    if (src.hasOwnProperty(key) && key.charAt(0) !== '$' && key.charAt(1) !== '$') { +    if (src.hasOwnProperty(key) && !(key.charAt(0) === '$' && key.charAt(1) === '$')) {        dst[key] = src[key];      }    } | 
