ECMAScript 6
In html I have button with id="update" and some other control elements with class="control". When I press "Update" button, other controls should disappear.
When I press the "Update" button, I get: "Uncaught type error: this.hide_controls is not a function".
This may help: if I stop at the breakpoint (see "debugger" in the code), then "this" equals to button#update.btn.btn-default.control.
Could you help me call hide_controls method.
class ButtonManager{
constructor (){
this.init_main_object_buttons();
}
init_main_object_buttons(){
this._main_object_update_button = $("#update");
this._main_object_update_button.click(this.update_main_object);
this._controls = $(".control");
}
hide_controls(){
this._controls.addClass("hide");
}
update_main_object(){
debugger;
this.hide_controls();
...
}
}