0

I created a small LWC, and I need to "plug" it in my angular web page, can I use Lightning out javascript in my angular page ?

I did it with Aura component and it works well, but Wondering if possible with LWC.

1 Answer 1

4

You can keep your aura component as a "empty shell" and embed your LWC in it :)

Example:

<!-- auraComponent.cmp file -->
<aura:component implements="flexipage:availableForAllPageTypes">
    <lightning:card title="Aura Hello World" iconName="custom:custom30" />
    <c:lwcHelloWorld name="Earthling" />
</aura:component>

Doc: https://developer.salesforce.com/docs/component-library/documentation/lwc/lwc.interop_aura_composition

6
  • Ok Nicolas thank you, I'll test it right now :) Commented Feb 5, 2020 at 9:17
  • you're welcome, please let me know if it works ^^ ( i don't use LWC yet ^^ ) :) Commented Feb 5, 2020 at 9:25
  • It works well, now wondering if I can declare a variable in my Aura, and use this var in my LWC (which is inside my Aura) ? Commented Feb 5, 2020 at 16:55
  • Great :) Just send the variable as a parameter to your lwc component ? <aura:component implements="flexipage:availableForAllPageTypes"> <aura:attribute name="myVar" type="String" /> <c:lwcHelloWorld name="{!v.myVar}" /> </aura:component> Commented Feb 5, 2020 at 17:22
  • Hi, Nicolas (sorry for delay) yes variables con be passed from aura to LWC, but I'm still wondering how to ambedd my LWC within my angular app ? (without any aura) Commented Feb 18, 2020 at 9:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .