From 776a83f9da51c7983b5c30e67c440f73117e5b4b Mon Sep 17 00:00:00 2001 From: Roberto Simonetti Date: Thu, 7 Jul 2016 17:48:37 +0200 Subject: [PATCH] doc(i18nPluralPipe): update API doc example (#9862) --- .../common/src/pipes/i18n_plural_pipe.ts | 20 ++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/modules/@angular/common/src/pipes/i18n_plural_pipe.ts b/modules/@angular/common/src/pipes/i18n_plural_pipe.ts index 16fe952115..f1b7cfec9a 100644 --- a/modules/@angular/common/src/pipes/i18n_plural_pipe.ts +++ b/modules/@angular/common/src/pipes/i18n_plural_pipe.ts @@ -26,9 +26,23 @@ const _INTERPOLATION_REGEXP: RegExp = /#/g; * ## Example * * ``` - *
- * {{ messages.length | i18nPlural: messageMapping }} - *
+ * class MyLocalization extends NgLocalization { + * getPluralCategory(value: any) { + * if(value > 1) { + * return 'other'; + * } + * } + * } + * + * @Component({ + * selector: 'app', + * template: ` + *
+ * {{ messages.length | i18nPlural: messageMapping }} + *
+ * `, + * providers: [{provide: NgLocalization, useClass: MyLocalization}] + * }) * * class MyApp { * messages: any[];