All of our typescript classes inherit (directly or indirectly) from:
export class WrObject {
    className:string;
    public instanceOf(name : String) : boolean {
        return this.className === name;
    }
}
We then declare a subclass as:
export class Section extends WrObject {
    public static CLASS_NAME = 'Section';
    className = Section.CLASS_NAME;
        public instanceOf(name : String) : boolean {
            if (this.className === name)
                return true;
            return super.instanceOf(name);
        }
}
And you can then check with:
if (obj.instanceOf(Section.CLASS_NAME))
It all works great. However, I think it would be cleaner if we could do:
if (obj.instanceOf(Section))
Is there any way to do that? Or any suggestions as to a better approach?
thanks - dave
 
     
     
     
    