5 lines
48 KiB
JSON
5 lines
48 KiB
JSON
{
|
|
"id": "api/common/NgPlural",
|
|
"title": "NgPlural",
|
|
"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/NgPlural\", \"name\": \"NgPlural\" } }\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/directives/ng_plural.ts?message=docs(common)%3A%20describe%20your%20change...#L14-L85\" 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/directives/ng_plural.ts#L14-L85\" 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=\"ngplural\">NgPlural<a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"api/common/NgPlural#ngplural\"><i class=\"material-icons\">link</i></a></h1>\n \n <label class=\"api-type-label directive\">directive</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>Adds / removes DOM sub-trees based on a numeric value. Tailored for pluralization.</p>\n\n <p><a href=\"api/common/NgPlural#description\">See more...</a></p>\n </section>\n \n \n \n \n\n <h2 id=\"ngmodule\">NgModule<a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"api/common/NgPlural#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<section class=\"selector-list\">\n <h2 id=\"selectors\">Selectors<a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"api/common/NgPlural#selectors\"><i class=\"material-icons\">link</i></a></h2>\n \n <ul>\n <li><code>[<a href=\"api/common/NgPlural\" class=\"code-anchor\">ngPlural</a>]</code></li>\n \n </ul>\n \n</section>\n\n\n\n \n\n<section class=\"instance-properties\">\n <h2 id=\"properties\">Properties<a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"api/common/NgPlural#properties\"><i class=\"material-icons\">link</i></a></h2>\n <table class=\"is-full-width list-table property-table\">\n <thead>\n <tr>\n <th>Property</th>\n <th>Description</th>\n </tr>\n </thead>\n <tbody>\n \n <tr class=\"instance-property\">\n <td>\n <a id=\"ngPlural\"></a>\n <code class=\"\"><span class=\"property-binding\">@<a href=\"api/core/Input\" class=\"code-anchor\">Input</a>()</span><br><span class=\"member-name\"><a href=\"api/common/NgPlural\" class=\"code-anchor\">ngPlural</a></span>: number</code>\n </td>\n <td><span class=\"write-only-property\">Write-Only</span>\n \n \n \n </td>\n </tr>\n \n </tbody>\n </table>\n</section>\n\n\n\n \n\n\n \n <section class=\"description\">\n <h2 id=\"description\">Description<a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"api/common/NgPlural#description\"><i class=\"material-icons\">link</i></a></h2>\n <p>Displays DOM sub-trees that match the switch expression value, or failing that, DOM sub-trees\nthat match the switch expression's pluralization category.</p>\n<p>To use this directive you must provide a container element that sets the <code>[<a href=\"api/common/NgPlural\" class=\"code-anchor\">ngPlural</a>]</code> attribute\nto a switch expression. Inner elements with a <code>[<a href=\"api/common/NgPluralCase\" class=\"code-anchor\">ngPluralCase</a>]</code> will display based on their\nexpression:</p>\n<ul>\n<li>if <code>[<a href=\"api/common/NgPluralCase\" class=\"code-anchor\">ngPluralCase</a>]</code> is set to a value starting with <code>=</code>, it will only display if the value\nmatches the switch expression exactly,</li>\n<li>otherwise, the view will be treated as a \"category match\", and will only display if exact\nvalue matches aren't found and the value maps to its category for the defined locale.</li>\n</ul>\n<p>See <a href=\"http://cldr.unicode.org/index/cldr-spec/plural-rules\">http://cldr.unicode.org/index/cldr-spec/plural-rules</a></p>\n\n <code-example>\n<some-element [<a href=\"api/common/NgPlural\" class=\"code-anchor\">ngPlural</a>]=\"value\">\n <ng-template <a href=\"api/common/NgPluralCase\" class=\"code-anchor\">ngPluralCase</a>=\"=0\">there is nothing</ng-template>\n <ng-template <a href=\"api/common/NgPluralCase\" class=\"code-anchor\">ngPluralCase</a>=\"=1\">there is one</ng-template>\n <ng-template <a href=\"api/common/NgPluralCase\" class=\"code-anchor\">ngPluralCase</a>=\"few\">there are a few</ng-template>\n</some-element>\n</code-example>\n\n </section>\n \n\n \n\n \n\n \n\n<section class=\"instance-methods\">\n <h2 id=\"methods\">Methods<a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"api/common/NgPlural#methods\"><i class=\"material-icons\">link</i></a></h2>\n \n <a id=\"addCase\"></a>\n<table class=\"is-full-width method-table instance-method\">\n <thead><tr><th>\n <div class=\"with-github-links\">\n <h3 id=\"addcase\">\n addCase()\n \n <a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"api/common/NgPlural#addcase\"><i class=\"material-icons\">link</i></a></h3>\n <div class=\"github-links\">\n <a href=\"https://github.com/angular/angular/edit/master/packages/common/src/directives/ng_plural.ts?message=docs(common)%3A%20describe%20your%20change...#L62-L65\" 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/directives/ng_plural.ts#L62-L65\" aria-label=\"View Source\" title=\"View Source\"><i class=\"material-icons\" aria-hidden=\"true\" role=\"img\">code</i></a>\n</div>\n </div>\n </th></tr></thead>\n <tbody>\n \n \n <tr>\n <td>\n <div class=\"overload-info\">\n \n\n <code-example language=\"ts\" hidecopy=\"true\" class=\"no-box api-heading\"><span class=\"member-name\">addCase</span>(value: string, switchView: SwitchView): void</code-example>\n\n \n\n <h6 class=\"no-anchor\" id=\"parameters\">Parameters</h6>\n <table class=\"is-full-width list-table parameters-table instance-method-overload-parameters\">\n <tbody>\n \n <tr class=\"instance-method-overload-parameter\">\n <td class=\"param-name\">\n <a id=\"\"></a>\n <code>value</code>\n </td>\n <td class=\"param-type\"><code>string</code></td>\n <td class=\"param-description\">\n \n \n </td>\n </tr>\n <tr class=\"instance-method-overload-parameter\">\n <td class=\"param-name\">\n <a id=\"\"></a>\n <code>switchView</code>\n </td>\n <td class=\"param-type\"><code>SwitchView</code></td>\n <td class=\"param-description\">\n \n \n </td>\n </tr>\n </tbody>\n</table>\n\n \n <h6 class=\"no-anchor\" id=\"returns\">Returns</h6>\n <p><code>void</code></p>\n\n \n\n\n \n\n \n</div>\n </td>\n </tr>\n \n\n \n\n \n </tbody>\n</table>\n\n \n</section>\n\n \n \n \n\n </div>\n</article>\n\n<!-- links to this doc:\n - api/common\n - api/common/CommonModule\n - api/common/NgPluralCase\n - api/common/Plural\n - api/common/getLocalePluralCase\n-->\n<!-- links from this doc:\n - /api\n - api/common\n - api/common/CommonModule\n - api/common/NgPlural#addcase\n - api/common/NgPlural#description\n - api/common/NgPlural#methods\n - api/common/NgPlural#ngmodule\n - api/common/NgPlural#ngplural\n - api/common/NgPlural#properties\n - api/common/NgPlural#selectors\n - api/common/NgPluralCase\n - api/core/Input\n - http://cldr.unicode.org/index/cldr-spec/plural-rules\n - https://github.com/angular/angular/edit/master/packages/common/src/directives/ng_plural.ts?message=docs(common)%3A%20describe%20your%20change...#L14-L85\n - https://github.com/angular/angular/edit/master/packages/common/src/directives/ng_plural.ts?message=docs(common)%3A%20describe%20your%20change...#L62-L65\n - https://github.com/angular/angular/tree/12.0.0-next.7/packages/common/src/directives/ng_plural.ts#L14-L85\n - https://github.com/angular/angular/tree/12.0.0-next.7/packages/common/src/directives/ng_plural.ts#L62-L65\n-->"
|
|
} |