![]() |
VOOZH | about |
The json filter in AngularJs is used to convert a JavaScript object into a JSON. string.JavaScript object that we are using can be of any kind of JavaScript Object. The json filter piped the object or any expression with JSON so that the result will be displayed in the form of a list, which is bound with the expression syntax.
Syntax:
{{ object | json : spacing }}Parameter value:
Example 1: This example will display the marks of students in JSON.
Output:
Example 2: This example will display the fruits name in JSON with 10 spaces per indentation
Output: