79522273

Date: 2025-03-20 08:20:10
Score: 0.5
Natty:
Report link

This is because *ngIf="selectedId() is evaluated as FALSE when value is 0: https://developer.mozilla.org/en-US/docs/Glossary/Falsy

Something like:

<div *ngIf="selectedId()?.toString() as id">Current id: {{ id }}</div>

should do the trick. If you id is null, this will not show anything, but if is 0, it will be evaluate as true as this is a string.

Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Sa Hagin