Hello, I have a view that references 2 other view in this way:
MainView:
return {
rows: [
{
// type: “space”,
cols: [
{rows: [ContentView]}, SideView
]
}
]
}
The “ContentView” has an id: id: “contentView”.
If in the init() of the MainView I try to access to $$(“contentView”) i get “undefined”, that’s because the init is not synced with the end of the rendering of the contentView.
In fact if I try to accesso to $$(‘contentView’) after 2 second , I get the correct reference.
init() {
console.log($$(“contentView”)); //undefined
setTimeout(function(){
console.log($$(“contentView”)); // object
},2000);
}
How can I avoid this problem?
thank you