Sitelet https://github.com/angular/angular/issues/38144
Skip to content

Plural expression within ng-container with ngIf prevents following markup from being rendered聽#38144

Description

@anton-github

馃悶 bug report

Affected Package

It seems like any angular version with Ivy enabled is affected.

Is this a regression?

Since Ivy is enabled by default in the newer versions I would say yes, it's a regression.

Description

Plurals ICU expressions prevent following markup from being rendered when used within ng-container with ngIf on it. For version 10 it's true only for subsequent renderings, see examples in the next section.
Short code example:

  <ng-container *ngIf="true">
    you have {{ 1 }} {1, plural, one {task} other {tasks}} to do
  </ng-container>

On subsequent renderings the code above will render you have 1 task

馃敩 Minimal Reproduction

Toggle block visibility by clicking button to see how the result is changed

https://stackblitz.com/edit/plural-ng8 - all is OK
https://stackblitz.com/edit/plural-ng9rc1 - is OK with Ivy disabled, otherwise the behavior is wrong for both first and subsequent renderings
https://stackblitz.com/edit/plural-ng10 - is OK with Ivy disabled, otherwise the behavior is wrong only for subsequent renderings

馃敟 Exception or Error

Nothing is logged

馃實 Your Environment

Angular Version:
Please see stackblitz examples dependencies above

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2The issue is important to a large percentage of users, with a workaroundarea: i18nIssues related to localization and internationalizationfreq2: mediumregressionIndicates than the issue relates to something that worked in a previous versionstate: confirmedtype: bug/fix

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions