elements',
+ inject(
+ [TestComponentBuilder, AsyncTestCompleter],
+ (tcb: TestComponentBuilder, async: AsyncTestCompleter) => {
+ var template = '' +
+ '' +
+ 'you have no messages.' +
+ 'you have one message.' +
+ '
';
+
+ tcb.overrideTemplate(TestComponent, template)
+ .createAsync(TestComponent)
+ .then((fixture) => {
+ fixture.debugElement.componentInstance.switchValue = 0;
+ fixture.detectChanges();
+ expect(fixture.debugElement.nativeElement).toHaveText('you have no messages.');
+
+ fixture.debugElement.componentInstance.switchValue = 1;
+ fixture.detectChanges();
+ expect(fixture.debugElement.nativeElement).toHaveText('you have one message.');
+
+ async.done();
+ });
+ }));
+
it('should display the template according to the category',
inject(
[TestComponentBuilder, AsyncTestCompleter],
@@ -124,9 +149,7 @@ export class TestLocalizationMap extends NgLocalization {
}
-@Component({selector: 'test-cmp', directives: [NgPlural, NgPluralCase], template: ''})
+@Component({selector: 'test-cmp', directives: [NgPluralCase, NgPlural], template: ''})
class TestComponent {
- switchValue: number;
-
- constructor() { this.switchValue = null; }
+ switchValue: number = null;
}
diff --git a/modules/@angular/compiler/src/i18n/expander.ts b/modules/@angular/compiler/src/i18n/expander.ts
index c7bd450cac..86ec0bb5ca 100644
--- a/modules/@angular/compiler/src/i18n/expander.ts
+++ b/modules/@angular/compiler/src/i18n/expander.ts
@@ -22,17 +22,16 @@ const PLURAL_CASES: string[] = ['zero', 'one', 'two', 'few', 'many', 'other'];
* will be expanded into
*
* ```
- *
- * - zero
- * - one
- * - more than one
- *
+ *
+ * zero
+ * one
+ *