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

Commit d2be593

Browse files
Spencer Applegatepetebacondarwin
Spencer Applegate
authored andcommitted
docs(Angular.js): explain that toJson strips $... properties
In Angular.toJson, any properties with a leading '$' character will be stripped from the resulting string since angular uses this notation internally for services. There have been complaints of not knowing about this functionality until it breaks within their code.
1 parent 9a77d03 commit d2be593

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Angular.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -746,7 +746,8 @@ function toJsonReplacer(key, value) {
746746
* @function
747747
*
748748
* @description
749-
* Serializes input into a JSON-formatted string.
749+
* Serializes input into a JSON-formatted string. Properties with leading $ characters will be
750+
* stripped since angular uses this notation internally.
750751
*
751752
* @param {Object|Array|Date|string|number} obj Input to be serialized into JSON.
752753
* @param {boolean=} pretty If set to true, the JSON output will contain newlines and whitespace.

0 commit comments

Comments
 (0)