TypeScript interfaces are erased at runtime, so there is no instanceof for them. A pair of pure pipes can act as discriminators — each pipe checks for a unique property and returns the narrowed object or null, letting @if (... as typed) bind a properly-typed local in the template.
| ID | First name | Last name | Office number | Reason |
|---|---|---|---|---|
| 1 | A | B | 1 | |
| 2 | C | D | 2 | |
| 3 | E | F | passport | |
| 4 | G | H | 3 | |
| 5 | I | J | visum |
Changing the counter binding does not trigger the pipe functions