You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm looking into seeing if I can convert an existing Dojo project to TypeScript using these typings and I'm having trouble calling this.inherited(arguments) in classes that I am declaring.
To reproduce, simply add the following to the Dialog class definition in the example/basicApp project:
destroy(){this.inherited(arguments);}
which gives the error "src/app/Dialog.ts(24,8): error TS2339: Property 'inherited' does not exist on type 'Dialog'" rather than just working.
Is there a different way to call the base classes method from an inheriting class? I can't seem to find any references of how to do this in the repository.
tsc --version
Version 2.6.2
Thanks in advance
The text was updated successfully, but these errors were encountered:
remag9330
changed the title
Property 'inherited' does not exist on type ...
Property 'inherited' does not exist on type <...>
Feb 1, 2018
I had some time to look into this today, and it makes sense that currently decorators cannot alter the supplied class as the class has to exist before being passed in to the decorator function. See microsoft/TypeScript#4881 for a relevant typescript request on mutating decorators.
In the meantime I've just added dojo._base.DeclareCreatedObject to the interface declaration of my classes as a hacky workaround to gain access to this.inherited functions, which works but I'm not happy with it. Still open for any better suggestions.
Hi,
I'm looking into seeing if I can convert an existing Dojo project to TypeScript using these typings and I'm having trouble calling
this.inherited(arguments)
in classes that I am declaring.To reproduce, simply add the following to the Dialog class definition in the example/basicApp project:
which gives the error "src/app/Dialog.ts(24,8): error TS2339: Property 'inherited' does not exist on type 'Dialog'" rather than just working.
Is there a different way to call the base classes method from an inheriting class? I can't seem to find any references of how to do this in the repository.
Thanks in advance
The text was updated successfully, but these errors were encountered: