A developer is creating a new component to be included in an SPA. They created a Sling Model and React component but are experiencing issues getting them to work together.
Which change is needed to make sure these two components work together?
A.
Extend the AEM Component component with the MapTo component.
B.
In the AEM Component, implement a MapTo method that references the Sling Model.
C.
In the React component, implement a MapTo method that references the AEM component.
In AEM SPA Editor, the MapTo function is used in the React (or Angular) component to map a frontend component to its corresponding AEM component resource type (Sling Model). This ensures data from the Sling Model is properly bound to the SPA component.
Correct: React component implements MapTo with the AEM component resource type.
Incorrect: The AEM Component or Sling Model itself does not implement MapTo.
Adobe Documentation:
“SPA components must call MapTo in the JavaScript app to map a frontend component to an AEM component resource type. This enables the Sling Model data to be injected into the SPA component.”
— AEM SPA Editor – MapTo Function
Contribute your Thoughts:
Chosen Answer:
This is a voting comment (?). You can switch to a simple comment. It is better to Upvote an existing comment if you don't have anything to add.
Submit