[SalesForce] Can you embed visualforce inside a lightning component

Can you embed or implement a visualforce page inside of a lightning component?

For example I do a load of HTML, Javascript and angular and embedding inside a visualforce, then however with a lightning component implement the visualforce page inside of the lightning component?

So when I put the lightning component into the salesforce1 app – I can then see all the code for the visualforce page?

Best Answer

Yes you can. The linked post gives a wider tutorial, but the code you likely need is below. Note, here I have added recordId to my example as it is common that the VF page needs a reference to the record. Other parameters can be passed in a similar way.

<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,force:hasRecordId" access="global">
    <iframe src="{! 'https://my-demo--c.eu11.visual.force.com/apex/MyVisualforcePage?Id=' + v.recordId }" width="100%" height="500px;" frameBorder="0"/>
</aura:component>
Related Topic