1
Could someone tell me how I do a set of an MVC Javascript class? I send, but every time I search the value to check it gets Undefined. Follow example:
charController.js:
class CharController {
constructor() {
this._charNameSelected;
this.initialize();
}
get charNameSelected() {
return this._charNameSelected;
}
set charNameSelected(value) {
this._charNameSelected = value;
}
initialize() {
console.log(this.charNameSelected);
}
}
charModel.js:
objCharController = new CharController();
objCharController.charNameSelected = "teste";
Put the code, not the image.
– Matheus Miranda
Okay, I’m new here, thanks for the tip.
– user70904