How to reuse one sling model into another in AEM SPA | Community
Skip to main content
Level 6
Nov 16, 2022 5:59 AM UTC
Solved

How to reuse one sling model into another in AEM SPA

I have written one Button SlingModel and I wanted to reuse it into another model. In SPA I can't achieve that. 
I tried with 

@1961677
@14766979
private ButtonModel buttonModel;

 

It is returning null. Is this possible?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
KNanAccepted solution
New Participant
Nov 16, 2022 8:29 AM UTC

3 replies

New Participant
Nov 16, 2022 6:48 AM UTC

Hi 

 

Please try this  @ inject

 

refer this  : https://stackoverflow.com/questions/39594183/inject-another-sling-model-from-sling-model

 

Thanks

Translate
Ronnie09Author
Level 6
Nov 16, 2022 7:21 AM UTC

Tried this and it didn't work

Translate
KNanAccepted solution
New Participant
Nov 16, 2022 8:29 AM UTC