Very similar to creating screen, almost the same.
import base_controller from "/libs/wpower/cvm/base-controller.js";
// If import wpower (minified):
// Use 'extends wpower.base_controller'
class my_com extends base_controller{
// Ctor
constructor(){
super();
}
// Before DOM, to change this.Data
init(){
// A must, binds methods to 'this'
super.init(this);
// Ensure prop exists for template
// or unnecessary err log is shown in Console
touch(this.Data,"Some_Prop_Name");
}
// After DOM, additional rendering, events
render(){
}
// Load data after UI is done
async load_data(){
}
}
HTML file can be left empty initially.
CSS file can be left empty initially.