# `json` (filter in module `ng` )

Improve this doc

## Description

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)`

### Parameters

- `object – {*} –`

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

### Returns

`{string}` –

JSON string.

## Example

#### Source

#### Demo