We can unescap the html by using this aura:unescapedHtml . This component is used to write the html content as it is without performing recalculation. Like we show our code in Blog without compile. Lets get more with a simple example.
Lightning Component :
<aura:component>
<!--Handler-->
<aura:handler name="init" value="{!this}" action="{!c.doInit}" />
<!--Attributes-->
<aura:attribute name="htmlstring" type="String" default=""/>
<div class="slds-m-around--xx-large">
With Render <aura:unescapedHtml value="{!v.htmlstring}"/>.
</div>
<div class="slds-m-around--xx-large">
Without Render <span>{!v.htmlstring}</span>.
</div>
</aura:component>
Lightning Controller :
({
doInit : function(component, event, helper) {
component.set("v.htmlstring", "<h1>Hello World!!</h1>");
}
})
What’s your Reaction?
+1
+1
+1
+1
+1
+1
2 comments
I am sure this paragraph has touched all
the internet viewers, its really really pleasant article on building up
new web site.
That is really fascinating, You’re an overly skilled blogger.I have joined your rss feed and sit up for searchingfor extra of your great
post. Additionally, I have shared your site in my social networks