NG-ZORRO/ng-zorro-antd

nz-badge : NG0955 when OverflowCount contains sames digits

Closed this issue · 0 comments

Reproduction link

https://stackblitz.com/edit/angular-haf5bj-w2wvuf?file=src%2Fapp%2Fapp.component.ts

Steps to reproduce

increment count in nz-badge component and OverflowCount contains sames digits (like the default value 99)

What is expected?

no warnings

What is actually happening?

NG0955: The provided track expression resulted in duplicated keys for a given collection

Environment Info
ng-zorro-antd 18.1.1
Browser chrome

The issue seems to be in NzBadgeSupComponent line 33 :
@for (n of maxNumberArray; track n; let i = $index) {

Replace "track n" with "track $index" and it should work