I\'m learning Angular2. I have a component with a variable which is an object. I\'m iterating over the fields of the object, and acording to the type of data of that positio
I just tried this and found it won't work in production because function names are shortened. It's safer to use something like:
foo instanceof FooClass
But note that you have to do this in the component/directive because instanceOf
is not available in templating:
// In your component
isFoo(candidate){
return candidate instanceof FooClass;
}
// in your template
{{isFoo(maybeFoo)}}