I thought this would be a simple base and child class task but this error is throwing me.
I created a base class like this:
module A.B.C {
export class instructionBase {
constructor(
var1: class1,
var2: class2,
...etc for 10 injected classes) { //init code }
method1(){}
method2(){}
}
}
My inherited class is like this:
namespace A.B.C {
export class instructionComponent extends instructionBase {
static $inject = ["", "", ""...for 10 times]
constructor(
var1: class1,
etc for 10 times) {
super(var1, for 10 times)
}
}
// Register the component
angular.module("myApp.abc")
.component("instructioncomponent", {
templateUrl: "/.../instruction.component.html",
controllerAs: "vm",
transclude: true,
controller: instructionComponent
});
}
At run time I get this error:
Uncaught TypeError: Object prototype may only be an Object or null: undefined at setPrototypeOf () at __extends (someOtherClassICreatedALongTimeAgo.js:6) at instrumentComponent.ts:4 at A.B.C (instrumentComponent.ts:4) at A.B.A.B(instrumentComponent.ts:45) at A (instrumentComponent.ts:45) at instrumentComponent.ts:45
What's interesting to me is that on line 6 of the error the namespace repeats twice partially. Do I have an unintended circular reference?
Looking at this class (someOtherClassICreatedALongTimeAgo) from the error it also extends a base class so I must have wires crossed somewhere.