简体   繁体   中英

Typescript create new instance in class

///<reference path="HtmlElementsAction.ts" />
///<reference path="DesktopSocket.ts" />

 module Pong {
        export class webPage extends HtmlElementsAction {
            private socket;

            constructor() {
                super();
                this.socket = new DesktopSocket(this);
            }
        }
    }

I've this code.

When I'm executing it, in browser's console is error:

Uncaught TypeError: undefined is not a function

Error is on new DesktopSocket(this);

What am I doing wrong?

Common error. Check the order of your script tags or if compiling with "out" the order of arguments to tsc.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM