Hello,
in a view i defined a constant in the config
config(){
const elmenet1 = { … }
}
is it possibile to get element1 from the init or ready function?
Hello,
in a view i defined a constant in the config
config(){
const elmenet1 = { … }
}
is it possibile to get element1 from the init or ready function?
you need to store required constant in some shared place.
export default class extends JetView {
config(){
const element1 = {...};
this.__element1 = element1;
}
init(){
const element1 = this.__element1;
}
destroy(){
delete this.__element1;//in case of memory leakage possibility
}
}
oh, it was easy
Thanks for the suggestion about the destroy method