angular.toJson

Improve this Doc View Source 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.

© 2010–2016 Google, Inc.
Licensed under the Creative Commons Attribution License 4.0.
https://code.angularjs.org/1.4.14/docs/api/ng/function/angular.toJson

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部