How to bind AEM component to another using SPA. (data-sly-resource in the traditional way) | Community
Skip to main content
Level 2
July 24, 2023
Solved

How to bind AEM component to another using SPA. (data-sly-resource in the traditional way)

  • July 24, 2023
  • 1 reply
  • 1892 views

Hi Everyone.

I'm working with SPA in AEM, I have a question on how to embed another component into an AEM component using SPA React.

In the traditional way, I can use data-sly-resource to implement it.

Thanks, guys

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Mahedi_Sabuj

Hi @luongpham1994, Please check the pull request https://github.com/MahediSabuj/aem-react-spa/pull/11 

- Extend Container core component in the Header Sling Model

- Add List and Button component in the component _cq_template

- Include the component in the React using this.childComponents[0], this.childComponents[1], ...

Author View:

1 reply

Mahedi_Sabuj
Community Advisor
Community Advisor
July 24, 2023
Level 2
July 26, 2023

Hi @mahedi_sabuj , Thanks for your response.

I just read the article you posted above and still be not sure how to embed another component into a parent component.

In my case, I have a header component that includes a button component and a list component like this image.

 

Mahedi_Sabuj
Community Advisor
Mahedi_SabujCommunity AdvisorAccepted solution
Community Advisor
July 26, 2023

Hi @luongpham1994, Please check the pull request https://github.com/MahediSabuj/aem-react-spa/pull/11 

- Extend Container core component in the Header Sling Model

- Add List and Button component in the component _cq_template

- Include the component in the React using this.childComponents[0], this.childComponents[1], ...

Author View:

Mahedi Sabuj