angular.toJson
ng
Serializes input into a JSON-formatted string. Properties with leading $ characters will be stripped since angular uses this notation internally.
angular.toJson(obj[, pretty]);
Input to be serialized into JSON.
If set to true, the JSON output will contain newlines and whitespace.
JSON-ified string representing obj.
obj