1

I am new to lightning web components and I want to make a custom lwc and put it inside another custom lwc.

I know this is achievable via lightning with

<c:yourCustomComponent attribute1="value1" attribute2="value2"/>

But I'm not finding any clue on how to do this with web components.

Is there a way to achieve this?

1 Answer 1

5

You can check this documentation Set Properties on Child Components.

NOTE Property names in JavaScript are in camel case while HTML attribute names are in kebab case (dash-separated) to match HTML standards. In todoApp.html, the item-name attribute in markup maps to the itemName JavaScript property of c-todo-item.

Your code should be like:

<c-your-custom-component attribute1="value1" attribute2="value2" att3={trackedJavascriptProperty}></c-your-custom-component>
1
  • Thanks a lot! That's exactly what I needed
    – molinet
    Sep 18, 2019 at 10:15

You must log in to answer this question.

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