-
Notifications
You must be signed in to change notification settings - Fork 4.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Badge directive with badgeDisabled condition not working #12736
Comments
I have this bug too.
If i remove the [badgeDisabled]="nbNotifications == 0" the value never change.
|
Yep same here ! Here's a repro repo. |
Hello, i'm facing the same issue, cannot hide the badge in my notification icon. Thanks |
You can use the p-overlay-badge style class as a workaround: <span class="p-overlay-badge">
<i class="pi pi-bell"></i>
<p-badge *ngIf="user.notifications > 0" [value]="user.notifications"></p-badge>
</span> |
I confirm that the workaround provided by @diedel works. However, I would prefer the |
Describe the bug
The following does not work when
user.notifications
changes value to/from zero.If the initial result from
user.notifications === 0
istrue
, then the badge will remain hidden even if the value of user.notifications changes, souser.notifications === 0
result is updated tofalse
, the badge is still hidden, but at that point should be shown.Environment
PrimeNG 14.2.3
Reproducer
No response
Angular version
14
PrimeNG version
14.2.3
Build / Runtime
Angular CLI App
Language
TypeScript
Node version (for AoT issues node --version)
16.16.0
Browser(s)
Chrome
Steps to reproduce the behavior
No response
Expected behavior
badgeDisabled should reevaluate when a new value is passed to it.
The text was updated successfully, but these errors were encountered: