NgPlural

Experimental

Directive

What it does

Adds / removes DOM sub-trees based on a numeric value. Tailored for pluralization.

How to use

<some-element [ngPlural]="value"> <template ngPluralCase="=0">there is nothing</template> <template ngPluralCase="=1">there is one</template> <template ngPluralCase="few">there are a few</template> </some-element>

Class Overview

class NgPlural {
constructor(_localization: NgLocalization)

ngPlural 
addCase(value: string, switchView: SwitchView) : void

}

Selectors

[ngPlural]

Class Description

Constructor

constructor(_localization: NgLocalization)

Class Details

exported from @angular/common/index, defined in @angular/common/src/directives/ng_plural.ts