Serializes input into a JSON-formatted string. Properties with leading $$ characters will be stripped since angular uses this notation internally.
angular.toJson(obj, pretty);
| Param | Type | Details | 
|---|---|---|
| obj | ObjectArrayDatestringnumber | Input to be serialized into JSON. | 
| pretty | booleannumber | If set to true, the JSON output will contain newlines and whitespace. If set to an integer, the JSON output will contain that many spaces per indentation (the default is 2). | 
| stringundefined | JSON-ified string representing  |