This repository was archived by the owner on Apr 12, 2024. It is now read-only.
toJsonReplacer() patch to support Badgerfish Json format #4526
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello,
some strange backends, like ours, may accept only Badgerfish Json format which expects text leave nodes to be sent with a single '$' key, ref: http://badgerfish.ning.com.
I have seen toJsonReplacer() has been changed from rc2 to rc3 in a way which makes it ease to get it working (by adding the key length as qualification), this is a patch that introduces the change:
--- angular.js 2013-10-18 07:06:34.000000000 +0000
+++ angular.js.patched 2013-10-18 07:03:29.000000000 +0000
@@ -888,7 +888,7 @@
function toJsonReplacer(key, value) {
var val = value;
if (typeof key === 'string' && key.charAt(0) === '$') {
if (typeof key === 'string' && key.length > 1 && key.charAt(0) === '$') { val = undefined; } else if (isWindow(value)) { val = '$WINDOW';
Would it be possible to make it in the stable path?
Many thanks in any case!
Best regards
Roman