I have a problem with expanding elements where I get:
Uncaught TypeError: Cannot read the 'prototype' property from undefined
From what I read, the elements should be defined in a specific order, so here is what I am doing, as it seems that they are in the correct order.
This does not happen at compile time, but at runtime in the browser. I compile files into a single file with browserify and tsify .
Here is my main.ts entry point :
import GameSmartWeb from './GameSmartWeb'; window.gs = new GameSmartWeb();
He then calls this GameSmartWeb.ts file, which references the GUI class:
import GUI from './apis/GUI'; export default class GameSmartWeb { public get gui(): GUI { return new GUI(); } }
Then the apis / GUI.ts GUI class looks something like this:
export default class GUI extends GameSmartWeb { public get rewards(): Rewards { return new Rewards(); } } class Rewards extends GUI {
When viewed in a browser, it says the error is here:
var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
javascript typescript
Get Off My Lawn
source share