Im currently getting into es6 and want to use the class pattern. But how come "this.hola" is undefined in "onResize()"?
class Ui {
constructor() {
this.win = $(window);
this.hola = 'hola';
this.init();
}
init() {
this.addListeners();
}
addListeners() {
this.win.on('resize load', this.onResize);
}
onResize() {
console.log(this.hola);
}
}
export default Ui;