Communities for your favorite technologies. Explore all Collectives
Stack Overflow for Teams is now called Stack Internal. Bring the best of human thought and AI automation together at your work.
Bring the best of human thought and AI automation together at your work. Learn more
Find centralized, trusted content and collaborate around the technologies you use most.
Stack Internal
Knowledge at work
Bring the best of human thought and AI automation together at your work.
How to render dynamic html inside {{ name }}?
{{ name }}
let fname="faisal"; data1="<h1>{{fname}}</h1>"; let lname="Khan"; data2="<h1>{{lname}}</h1>";
how to get output like this : {{ data1 }} {{ data2 }} = faisal khan
{{ data1 }} {{ data2 }}
faisal khan
h1
<h1>{{ fname }} {{ lname }}</h1>
You can display your full name without data1, data2
If you have data1, data2 you need style for h1 display: inline-block
data1
data2
display: inline-block
<h1>{{fname}} {{lname}}</h1>
Demo https://stackblitz.com/edit/angular-pcw58e
Add a comment
Required, but never shown
By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.
Start asking to get answers
Find the answer to your question by asking.
Explore related questions
See similar questions with these tags.
h1into the template, then do<h1>{{ fname }} {{ lname }}</h1>? That way you'll only have a single element, too.