Serializes the input into a JSON formated string.
angular.toJson(obj, pretty);
obj – {Object|Array|Date|string|number} –
Input to jsonify.pretty(optional) – {boolean} –
If set to true, the JSON output will contain newlines and whitespace.string
– Jsonified string representing obj
.