Как инициализирвоать массив Get? Я как уже не пытался все никак:
import Cell from './Cell';
export default class Cells {
Get: Cell[];
constructor(x: number, y: number) {
for (let i = 0; i < x; i++) {
this.Get[i] = new Cell[x];
for (let j = 0; j < y; j++) {
this.Get[i][j] = new Cell(x, y, this._createHtmlElement());
}
}
}
_createHtmlElement(): HTMLElement {
let t = document.createElement("div");
t.classList.add("cell");
return t;
}
}
В данной реализации ошибка такая:
TypeError: __WEBPACK_IMPORTED_MODULE_0__Cell__.a[x] is not a constructor
Видимо у класса Cell должен быть конструктор без параметров. Я бы конечно его сделал, еслиб это помогло, но там еще оказывается больше одного конструктора нельзя? Что за бред?