Skip to main content
Level 2
July 24, 2023
解決済み

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

  • July 24, 2023
  • 5 の返信
  • 1935 ビュー

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

 

このトピックへの返信は締め切られました。
ベストアンサー 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:

5 の返信

Mahedi_Sabuj
Community Advisor
Community Advisor
July 24, 2023
luongpham1994作成者
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
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