I created a web js editor with angular and ngx-ace-wrapper lib. Now I trying to output a console.log to HTML div element. But I do not found any solution. How I can get console output or mirror to my DOM.
I tried to override conmsole.log and console.error
"preview" is a variable where I store my output as innerHTML
console.log = message => {
this.preview += message + "\n";
_log(message);
}
console.error = error => {
this.preview += JSON.stringify(error) + "\n";
_error(error);
}