In the following code, I get undefined reference for this.lister
in the create_components
method. I am trying to understand the meaning of this
(apparently changes based on how you call the method) but it would be great if someone can point out the rule why this
does not bind to the ScreenCreator
and how can I achieve that.
Thank you!
function ScreenCreator(config, container) {
this.lister = new Lister();
this.goldenlayout = new GoldenLayout(config, container);
this.create_components();
this.goldenlayout.init();
}
ScreenCreator.prototype.create_components = function() {
this.goldenlayout.registerComponent('comp1', function (container, state) {
this.lister.init(container, state);
});
}