angular.toJson
(API in module ng
)
Serializes input into a JSON-formatted string.
angular.toJson(obj[, pretty]);
obj – {Object|Array|Date|string|number} –
Input to be serialized into JSON.
pretty(optional) – {boolean=} –
If set to true, the JSON output will contain newlines and whitespace.
{string}
– Jsonified string representing obj
.