Expand my Community achievements bar.

Nomination window for the Adobe Community Advisor Program, Class of 2025, is now open!
SOLVED

How to reuse one sling model into another in AEM SPA

Avatar

Level 7

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 

@Deleted Account
@getter
private ButtonModel buttonModel;

 

It is returning null. Is this possible?

1 Accepted Solution

Avatar

Correct answer by
Community Advisor
3 Replies

Avatar

Community Advisor

Hi 

 

Please try this  @ inject

 

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

 

Thanks

Avatar

Level 7

Tried this and it didn't work

Avatar

Correct answer by
Community Advisor