forked from angular/code.angularjs.org
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathangular.toJson.html
16 lines (16 loc) · 1.96 KB
/
angular.toJson.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<a href="http://github.com/angular/angular.js/tree/v1.2.8/src/Angular.js#L924" class="view-source btn btn-action"><i class="icon-zoom-in"> </i> View source</a><a href="http://github.com/angular/angular.js/edit/master/src/Angular.js" class="improve-docs btn btn-primary"><i class="icon-edit"> </i> Improve this doc</a><h1><code ng:non-bindable="">angular.toJson</code>
<div><span class="hint">API in module <code ng:non-bindable="">ng</code>
</span>
</div>
</h1>
<div><h2 id="description">Description</h2>
<div class="description"><div class="angular-tojson-page"><p>Serializes input into a JSON-formatted string. Properties with leading $ characters will be
stripped since angular uses this notation internally.</p>
</div></div>
<h2 id="usage">Usage</h2>
<div class="usage"><pre class="prettyprint linenums">angular.toJson(obj[, pretty]);</pre>
<h4 id="usage_parameters">Parameters</h4><table class="variables-matrix table table-bordered table-striped"><thead><tr><th>Param</th><th>Type</th><th>Details</th></tr></thead><tbody><tr><td>obj</td><td><a href="" class="label type-hint type-hint-object">Object</a><a href="" class="label type-hint type-hint-array">Array</a><a href="" class="label type-hint type-hint-date">Date</a><a href="" class="label type-hint type-hint-string">string</a><a href="" class="label type-hint type-hint-number">number</a></td><td><div class="angular-tojson-page"><p>Input to be serialized into JSON.</p>
</div></td></tr><tr><td>pretty <div><em>(optional)</em></div></td><td><a href="" class="label type-hint type-hint-boolean">boolean</a></td><td><div class="angular-tojson-page"><p>If set to true, the JSON output will contain newlines and whitespace.</p>
</div></td></tr></tbody></table><h4 id="usage_returns">Returns</h4><table class="variables-matrix"><tr><td><a href="" class="label type-hint type-hint-string">string|undefined</a></td><td><div class="angular-tojson-page"><p>JSON-ified string representing <code>obj</code>.</p>
</div></td></tr></table></div>
</div>