Skip to content

Commit

Permalink
Update Angular.js toJson documentation
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Spencer Applegate committed Jun 29, 2013
1 parent a22596c commit a50ed98
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Angular.js
Original file line number Diff line number Diff line change
Expand Up @@ -755,7 +755,8 @@ function toJsonReplacer(key, value) {
* @function
*
* @description
* Serializes input into a JSON-formatted string.
* Serializes input into a JSON-formatted string. Properties with leading $ characters will be
* stripped since angular uses this notation internally.
*
* @param {Object|Array|Date|string|number} obj Input to be serialized into JSON.
* @param {boolean=} pretty If set to true, the JSON output will contain newlines and whitespace.
Expand Down

0 comments on commit a50ed98

Please sign in to comment.