UNPKG

angular2

Version:

Angular 2 - a web framework for modern web apps

38 lines (37 loc) 921 B
import { PipeTransform } from 'angular2/core'; /** * * Maps a value to a string that pluralizes the value properly. * * ## Usage * * expression | i18nPlural:mapping * * where `expression` is a number and `mapping` is an object that indicates the proper text for * when the `expression` evaluates to 0, 1, or some other number. You can interpolate the actual * value into the text using the `#` sign. * * ## Example * * ``` * <div> * {{ messages.length | i18nPlural: messageMapping }} * </div> * * class MyApp { * messages: any[]; * messageMapping: any = { * '=0': 'No messages.', * '=1': 'One message.', * 'other': '# messages.' * } * ... * } * ``` * */ export declare class I18nPluralPipe implements PipeTransform { transform(value: number, pluralMap: { [count: string]: string; }): string; }