Skip to content

Commit a50ed98

Browse files
author
Spencer Applegate
committed
Update Angular.js toJson documentation
I included in angular.toJson's description that any properties with a leading '$' character will be stripped from the result since angular uses this notation internally for services. There have been complaints of not knowing about this functionality until it breaks within their code. It would be a nice addition to avoid any confusion in the future. An example of a documentation update request is within a comment in issue angular#1463.
1 parent a22596c commit a50ed98

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)