We are building an application in Angular 2 and TypeScript. We try to statically check types where it is possible. Is there any way to check types in templates? Consider the fol
You could use a Pipe:
export class ObjectTypePipe implements PipeTransform { transform(value: any, args?: any): string { if (value != undefined && value != null) { return value.constructor.name.toString(); } return ""; } }
This would then allow you to do a string comparison.