5 lines
5.2 KiB
JSON
5 lines
5.2 KiB
JSON
{
|
|
"id": "api/common/JsonPipe",
|
|
"title": "JsonPipe",
|
|
"contents": "\n\n<article>\n <div class=\"breadcrumb-container\">\n <div class=\"breadcrumb\">\n <script type=\"application/ld+json\">\n {\n \"@context\": \"http://schema.org\",\n \"@type\": \"BreadcrumbList\",\n \"itemListElement\": [\n { \"@type\": \"ListItem\", \"position\": 1, \"item\": { \"@id\": \"https://angular.io//api\", \"name\": \"API\" } },\n { \"@type\": \"ListItem\", \"position\": 2, \"item\": { \"@id\": \"https://angular.io/api/common\", \"name\": \"@angular/common\" } },\n { \"@type\": \"ListItem\", \"position\": 3, \"item\": { \"@id\": \"https://angular.io/api/common/JsonPipe\", \"name\": \"JsonPipe\" } }\n ]\n }\n </script>\n <a href=\"/api\">API</a> > <a href=\"api/common\">@angular/common</a>\n </div>\n <div class=\"github-links\">\n <a href=\"https://github.com/angular/angular/edit/master/packages/common/src/pipes/json_pipe.ts?message=docs(common)%3A%20describe%20your%20change...#L10-L34\" aria-label=\"Suggest Edits\" title=\"Suggest Edits\"><i class=\"material-icons\" aria-hidden=\"true\" role=\"img\">mode_edit</i></a>\n <a href=\"https://github.com/angular/angular/tree/12.0.0-next.7/packages/common/src/pipes/json_pipe.ts#L10-L34\" aria-label=\"View Source\" title=\"View Source\"><i class=\"material-icons\" aria-hidden=\"true\" role=\"img\">code</i></a>\n</div>\n </div>\n \n <header class=\"api-header\">\n <h1 id=\"jsonpipe\">JsonPipe<a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"api/common/JsonPipe#jsonpipe\"><i class=\"material-icons\">link</i></a></h1>\n \n <label class=\"api-type-label pipe\">pipe</label>\n \n \n <label class=\"api-status-label impure-pipe\">impure</label>\n </header>\n \n <aio-toc class=\"embedded\"></aio-toc>\n\n <div class=\"api-body\">\n \n <section class=\"short-description\">\n <p>Converts a value into its JSON-format representation. Useful for debugging.</p>\n\n \n </section>\n \n \n \n<section class=\"pipe-overview\">\n <code-example hidecopy=\"true\" class=\"no-box api-heading\">{{ value_expression | <span class=\"kwd nocode\">json</span> }}</code-example>\n\n <h2 id=\"ngmodule\">NgModule<a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"api/common/JsonPipe#ngmodule\"><i class=\"material-icons\">link</i></a></h2>\n<ul class=\"ngmodule-list\">\n\n <li>\n <a href=\"api/common/CommonModule\">\n <code-example language=\"ts\" hidecopy=\"true\" class=\"no-box\">CommonModule</code-example>\n </a>\n </li>\n \n</ul>\n\n\n\n \n <h2 id=\"input-value\">Input value<a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"api/common/JsonPipe#input-value\"><i class=\"material-icons\">link</i></a></h2>\n <table class=\"is-full-width list-table parameters-table pipe-parameters\">\n <tbody>\n \n <tr class=\"pipe-parameter\">\n <td class=\"param-name\">\n <a id=\"\"></a>\n <code>value</code>\n </td>\n <td class=\"param-type\"><code>any</code></td>\n <td class=\"param-description\">\n <p>A value of any type to convert into a JSON-format string.</p>\n\n </td>\n </tr>\n </tbody>\n</table>\n \n \n</section>\n\n\n \n\n \n\n\n \n<section class=\"usage-notes\">\n <h2 id=\"usage-notes\">Usage notes<a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"api/common/JsonPipe#usage-notes\"><i class=\"material-icons\">link</i></a></h2>\n <p>The following component uses a JSON pipe to convert an object\nto JSON format, and displays the string in both formats for comparison.</p>\n<code-example path=\"common/pipes/ts/json_pipe.ts\" region=\"JsonPipe\">\n@<a href=\"api/core/Component\" class=\"code-anchor\">Component</a>({\n selector: 'json-pipe',\n template: `<div>\n <p>Without JSON pipe:</p>\n <pre>{{object}}</pre>\n <p>With JSON pipe:</p>\n <pre>{{object | <a href=\"api/common/JsonPipe\" class=\"code-anchor\">json</a>}}</pre>\n </div>`\n})\nexport class JsonPipeComponent {\n object: Object = {foo: 'bar', baz: 'qux', nested: {xyz: 3, numbers: [1, 2, 3, 4, 5]}};\n}\n\n</code-example>\n\n</section>\n\n\n\n </div>\n</article>\n\n<!-- links to this doc:\n - api/common\n - api/common/CommonModule\n - api/common/NgIf\n - api/common/http/HttpClient\n - api/core/PipeTransform\n - api/forms/NgForm\n - api/forms/NgModel\n - api/forms/RadioControlValueAccessor\n - api/forms/SelectControlValueAccessor\n - guide/ajs-quick-reference\n - guide/docs-style-guide\n - guide/pipes\n - guide/reactive-forms\n - guide/styleguide\n-->\n<!-- links from this doc:\n - /api\n - api/common\n - api/common/CommonModule\n - api/common/JsonPipe#input-value\n - api/common/JsonPipe#jsonpipe\n - api/common/JsonPipe#ngmodule\n - api/common/JsonPipe#usage-notes\n - api/core/Component\n - https://github.com/angular/angular/edit/master/packages/common/src/pipes/json_pipe.ts?message=docs(common)%3A%20describe%20your%20change...#L10-L34\n - https://github.com/angular/angular/tree/12.0.0-next.7/packages/common/src/pipes/json_pipe.ts#L10-L34\n-->"
|
|
} |