angular-cn/aio/dist/generated/docs/api/common/I18nPluralPipe.json

5 lines
6.4 KiB
JSON

{
"id": "api/common/I18nPluralPipe",
"title": "I18nPluralPipe",
"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/I18nPluralPipe\", \"name\": \"I18nPluralPipe\" } }\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/i18n_plural_pipe.ts?message=docs(common)%3A%20describe%20your%20change...#L16-L54\" 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/i18n_plural_pipe.ts#L16-L54\" 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=\"i18npluralpipe\">I18nPluralPipe<a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"api/common/I18nPluralPipe#i18npluralpipe\"><i class=\"material-icons\">link</i></a></h1>\n \n <label class=\"api-type-label pipe\">pipe</label>\n \n \n \n </header>\n \n <aio-toc class=\"embedded\"></aio-toc>\n\n <div class=\"api-body\">\n \n <section class=\"short-description\">\n <p>Maps a value to a string that pluralizes the value according to locale rules.</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\">i18nPlural</span> : pluralMap [ : locale ] }}</code-example>\n\n <h2 id=\"ngmodule\">NgModule<a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"api/common/I18nPluralPipe#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/I18nPluralPipe#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><a href=\"api/common/DecimalPipe\" class=\"code-anchor\">number</a></code></td>\n <td class=\"param-description\">\n <p>the number to be formatted</p>\n\n </td>\n </tr>\n </tbody>\n</table>\n \n \n <h2 id=\"parameters\">Parameters<a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"api/common/I18nPluralPipe#parameters\"><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>pluralMap</code>\n </td>\n <td class=\"param-type\"><code>object</code></td>\n <td class=\"param-description\">\n <p>an object that mimics the ICU format, see\n<a href=\"http://userguide.icu-project.org/formatparse/messages\">http://userguide.icu-project.org/formatparse/messages</a>.</p>\n\n </td>\n </tr>\n <tr class=\"pipe-parameter\">\n <td class=\"param-name\">\n <a id=\"\"></a>\n <code>locale</code>\n </td>\n <td class=\"param-type\"><code>string</code></td>\n <td class=\"param-description\">\n <p>a <code>string</code> defining the locale to use (uses the current <a href=\"api/core/LOCALE_ID\"><code>LOCALE_ID</code></a> by\ndefault).</p>\n<p> Optional. Default is <code>undefined</code>.</p>\n\n </td>\n </tr>\n </tbody>\n</table>\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/I18nPluralPipe#usage-notes\"><i class=\"material-icons\">link</i></a></h2>\n <h3 id=\"example\">Example<a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"api/common/I18nPluralPipe#example\"><i class=\"material-icons\">link</i></a></h3>\n<code-example path=\"common/pipes/ts/i18n_pipe.ts\" region=\"I18nPluralPipeComponent\">\n@<a href=\"api/core/Component\" class=\"code-anchor\">Component</a>({\n selector: 'i18n-plural-pipe',\n template: `&#x3C;div>{{ messages.length | <a href=\"api/common/I18nPluralPipe\" class=\"code-anchor\">i18nPlural</a>: messageMapping }}&#x3C;/div>`\n})\nexport class I18nPluralPipeComponent {\n messages: any[] = ['Message 1'];\n messageMapping:\n {[k: string]: string} = {'=0': 'No messages.', '=1': 'One message.', 'other': '# messages.'};\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/core/PipeTransform\n-->\n<!-- links from this doc:\n - /api\n - api/common\n - api/common/CommonModule\n - api/common/DecimalPipe\n - api/common/I18nPluralPipe#example\n - api/common/I18nPluralPipe#i18npluralpipe\n - api/common/I18nPluralPipe#input-value\n - api/common/I18nPluralPipe#ngmodule\n - api/common/I18nPluralPipe#parameters\n - api/common/I18nPluralPipe#usage-notes\n - api/core/Component\n - api/core/LOCALE_ID\n - http://userguide.icu-project.org/formatparse/messages\n - https://github.com/angular/angular/edit/master/packages/common/src/pipes/i18n_plural_pipe.ts?message=docs(common)%3A%20describe%20your%20change...#L16-L54\n - https://github.com/angular/angular/tree/12.0.0-next.7/packages/common/src/pipes/i18n_plural_pipe.ts#L16-L54\n-->"
}