overview
The $process method is called right after a components html has been inserted. If the component has no html, the $process method is still called. For components that retrieve data or some other non-visual action, the $process method is the primary method that implements the components functionality.
For components that have more complex html, the process method can be used to insert html into its html container. In such a case, the $process method should use the $id service to get the id of the inserted html.
Sample Data Component
When a component has no visual element, for example, a component that just retrieves data and inserts it into the workspace, the $process method is used to do the necessary processing.
this.$process = function($val, $url){
$url('/server/data.json').then(data=>{ $val.set('data', data);});
}
Sample Visual Component
When a componet has a visual element, it will typically implement the $html method, to return the html that represents the compoenent visually.
this.$html = function($id){
return '<div id="'+$id(this.config.id)+'"></div></div>'
}
After the $html method has been called, the $process method is called, which gives the component the ability to process the inserted HTML.
this.$process = function($id){
$('#'+$id(this.config.id)).html('some additional html here');
}