Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

ngPluralize not handling '0' count with empty whitespace rule properly #2575

Closed
siddii opened this issue May 3, 2013 · 2 comments
Closed

Comments

@siddii
Copy link
Contributor

siddii commented May 3, 2013

Here is the plunker test page for this issue - http://plnkr.co/0iKpGXso6XVuxzaDimvV
Please try entering '0' or other numbers in the text field and watch the result.

I read through the documentation & as far as I can see, the following two rules should be interpreted the same way.

  <ng-pluralize count="personCount"
                when="{'0': '',
                       '1': '{{personCount}} person is viewing.',
                       'other': '{{personCount}} people are viewing.'}">  
 </ng-pluralize>

  <ng-pluralize count="personCount"
                when="{'0': '&nbsp;',
                       '1': '{{personCount}} person is viewing.',
                       'other': '{{personCount}} people are viewing.'}">
  </ng-pluralize> 
@lgalfaso
Copy link
Contributor

lgalfaso commented May 7, 2013

It looks like the root cause of this is the falsy value of the empty string. Should be an easy fix

lgalfaso added a commit to lgalfaso/angular.js that referenced this issue May 7, 2013
Fix the check for overrides so it is able to handle the empty string

Closes angular#2575
@siddii
Copy link
Contributor Author

siddii commented May 7, 2013

Awesome 👍 It works as expected!

Here is a Plunk proving the result - http://plnkr.co/OiuaLGyrAJ75MHhGsVl7

petebacondarwin pushed a commit that referenced this issue May 10, 2013
Fix the check for overrides so it is able to handle the empty string

Closes #2575
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants