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

Commit 1532ec1

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 a22596c commit 1532ec1

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
@@ -755,7 +755,8 @@ function toJsonReplacer(key, value) {
755755
* @function
756756
*
757757
* @description
758-
* Serializes input into a JSON-formatted string.
758+
* Serializes input into a JSON-formatted string. Properties with leading $ characters will be
759+
* stripped since angular uses this notation internally.
759760
*
760761
* @param {Object|Array|Date|string|number} obj Input to be serialized into JSON.
761762
* @param {boolean=} pretty If set to true, the JSON output will contain newlines and whitespace.

0 commit comments

Comments
 (0)