I want to define a class in JavaScript (TypeScript) that one of its properties (indentListView
) is an instance of an external class. For defining the inner class instance, I want to access the outer class property (Selector.modalPanel
). How can I do this?
export class Selector {
indentListView // the inner class instance
modalPanel // the property I wanna access
constructor(SelectorItems) {
this.indentListView = new SelectListView({
didCancelSelection() {
Selector.modalPanel.hide() // using `this` here refers to SelectListView instead of Selector
return {}
},
})
this.modalPanel = atom.workspace.addModalPanel({
item: this.indentListView
})
}
}
I cannot use this
when I am initiating the inner class because of scoping issues.