doc(i18nPluralPipe): update API doc example (#9862)

This commit is contained in:
Roberto Simonetti 2016-07-07 17:48:37 +02:00 committed by Victor Berchet
parent f29457f3f0
commit 776a83f9da
1 changed files with 17 additions and 3 deletions

View File

@ -26,9 +26,23 @@ const _INTERPOLATION_REGEXP: RegExp = /#/g;
* ## Example
*
* ```
* <div>
* {{ messages.length | i18nPlural: messageMapping }}
* </div>
* class MyLocalization extends NgLocalization {
* getPluralCategory(value: any) {
* if(value > 1) {
* return 'other';
* }
* }
* }
*
* @Component({
* selector: 'app',
* template: `
* <div>
* {{ messages.length | i18nPlural: messageMapping }}
* </div>
* `,
* providers: [{provide: NgLocalization, useClass: MyLocalization}]
* })
*
* class MyApp {
* messages: any[];