angular.toJson

  1. function in module ng

Serializes input into a JSON-formatted string. Properties with leading $$ characters will be stripped since angular uses this notation internally.

Usage

angular.toJson(obj, pretty);

Arguments

Param Type Details
obj ObjectArrayDatestringnumber

Input to be serialized into JSON.

pretty
(optional)
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.

(default: 2)

Returns

stringundefined

JSON-ified string representing obj.

doc_AngularJS
2016-03-29 16:11:00
Comments
Leave a Comment

Please login to continue.