The question is same as Equivalent of $compile in Angular 2
But I have an element
<div>Hello {{name}}!</div>
I have defined name
in the class as
this.name = "<b>Mr_Perfect {{job}}</b>";
this.job = "UI Developer";
Now, I need to compile the div
dynamically. I just checked the above link and few answers are deprecated and the accepted answer in the question is good but need to write a lot of code just to compile a small element.
Are there any better methods in the recent releases of angular?