Still new in TypeScript, so this question may seem silly to some of you. I have a ToolTip class, for example:
class ToolTip{ public static show (str:string):void{ console.log ("ToolTip show():" + str); } public static hide():void{ console.log ("ToolTip hide()"); } } export = ToolTip;
And I want to call it from another class
import ToolTip = require ("app/view/common/Tooltip"); class Button { ...... private handleMouseEvent(event:MouseEvent):void { switch (event.type) { case "mouseover": ToolTip.show("tool tip string"); break; case "mouseout": ToolTip.hide(); break; } } ...... } export = MenuItem;
But this gives me this error:
Uncaught TypeError: Object app/view/common/Tooltip has no method 'show'
Any idea how to fix this?
static typescript
Dt dt
source share