{ "id": "api/common/I18nPluralPipe", "title": "I18nPluralPipe", "contents": "\n\n
\n
\n
\n \n API > @angular/common\n
\n \n
\n \n
\n

I18nPluralPipelink

\n \n \n \n \n \n
\n \n \n\n
\n \n
\n

Maps a value to a string that pluralizes the value according to locale rules.

\n\n \n
\n \n \n \n
\n {{ value_expression | i18nPlural : pluralMap [ : locale ] }}\n\n

NgModulelink

\n\n\n\n\n \n

Input valuelink

\n \n \n \n \n \n \n \n \n \n
\n \n value\n number\n

the number to be formatted

\n\n
\n \n \n

Parameterslink

\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n \n pluralMap\n object\n

an object that mimics the ICU format, see\nhttp://userguide.icu-project.org/formatparse/messages.

\n\n
\n \n locale\n string\n

a string defining the locale to use (uses the current LOCALE_ID by\ndefault).

\n

Optional. Default is undefined.

\n\n
\n \n
\n\n\n \n\n \n\n\n \n
\n

Usage noteslink

\n

Examplelink

\n\n@Component({\n selector: 'i18n-plural-pipe',\n template: `<div>{{ messages.length | i18nPlural: messageMapping }}</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\n\n
\n\n\n\n
\n
\n\n\n" }