Improve this Doc View Source json

  1. filter in module ng

Allows you to convert a JavaScript object into JSON string.

This filter is mostly useful for debugging. When using the double curly {{value}} notation the binding is automatically converted to JSON.

Usage

In HTML Template Binding

{{ json_expression | json}}

In JavaScript

$filter('json')(object)

Arguments

Param Type Details
object *

Any JavaScript object (including arrays and primitive types) to filter.

Returns

string

JSON string.

© 2010–2017 Google, Inc.
Licensed under the Creative Commons Attribution License 4.0.
https://code.angularjs.org/1.2.32/docs/api/ng/filter/json