Is interface

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.

Basic usage

IDFirst nameLast nameOffice numberReason
1AB1
2CD2
3EFpassport
4GH3
5IJvisum

Counter

1

Changing the counter binding does not trigger the pipe functions