I have a project where users can edit and add Angular Component code in HTML & TS format. When I use the HTML code on the view, it works correctly and shows the Angular Component. However, when retrieving it from the SQL database, only the text is displayed.
The HTML code comes from the database using a stored procedure with NVarchar data type.
TS Code :
this.stringifiedData = JSON.stringify(this.postdata);
this.helpService.GetComponentContent(this.uRL_Address, this.sp_Name,
this.stringifiedData).subscribe(val => {
this.tableJSon = val;
this.stringifiedData = JSON.stringify(this.tableJSon);
this.Table_JS_Data = JSON.parse(this.stringifiedData);
HTML:
{{this.Table_JS_Data[0].HtmlCode}}
And the result is:
https://i.sstatic.net/HpLLL.png
The problem is that I want to display it as an Angular component rather than just text. Is there a way to achieve this? Any ideas?