Hi Team,
Want to know what is the exact uses and differences of Inject & Valuemap. I can see in functionality vise both are doing the same thing. Can anyone explain why we need these annotations and what's the use of them.
Thanks.
Solved! Go to Solution.
Views
Replies
Total Likes
Hello @Tessa_learner1
@Inject is a general purpose annotation that makes the value available from a number of injectors.
@ValueMapValue is an injector specific annotation that will specifically pick value from valuemap injector. It is equivalent to @Inject @Source("valuemap")
When the injected value is available only from one injector, their behavior would be the same, however if the same property is provided by two different injectors (say script-binding and valuemap) they might inject different values.
Also, please refer to a similar thread https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/what-is-the-difference-bet...
Hello @Tessa_learner1
@Inject is a general purpose annotation that makes the value available from a number of injectors.
@ValueMapValue is an injector specific annotation that will specifically pick value from valuemap injector. It is equivalent to @Inject @Source("valuemap")
When the injected value is available only from one injector, their behavior would be the same, however if the same property is provided by two different injectors (say script-binding and valuemap) they might inject different values.
Also, please refer to a similar thread https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/what-is-the-difference-bet...
Views
Likes
Replies