Table of Contents
Question
SPA components are connected to AEM components via the MapTo() method. Which code should be used to correctly connect an SPA component called ItemList to its AEM equivalent?
A. (‘project/components/content/itemList’).MapTo(ItemList,ItemListEditConfig);
B. MapTo(‘project/components/content/itemList’)(ItemList,ItemListEditConfig);
C. ItemList.MapTo(‘project/components/content/itemList’);
D. MapTo(ItemList)(‘project/components/content/itemList’,ItemListEditConfig);
Answer
A. (‘project/components/content/itemList’).MapTo(ItemList,ItemListEditConfig);
Explanation
The correct code to connect an SPA component called ItemList to its AEM equivalent using the MapTo() method is: A. (‘project/components/content/itemList’).MapTo(ItemList, ItemListEditConfig);
The MapTo() method is used to connect an SPA component to its AEM equivalent by specifying the resourceType of the AEM component that corresponds to the SPA component. In this case, the resourceType of the AEM component is ‘project/components/content/itemList’, and the SPA component is referred to as ItemList.
The correct syntax for using MapTo() is as follows (‘AEM_Component_ResourceType’).MapTo(SPA_Component_Class, SPA_Component_EditConfig);
- ‘AEM_Component_ResourceType’: This should be the resourceType of the AEM component that you want to map the SPA component to.
- SPA_Component_Class: This should be the class or component name of the SPA component that you want to map.
- SPA_Component_EditConfig: This should be the optional configuration for the SPA component, specifying how it should be displayed in AEM’s edit mode.
Option A correctly follows this syntax, where the resourceType is ‘project/components/content/itemList’, and the SPA component class is ItemList. It also mentions the optional ItemListEditConfig for the SPA component.
Options B, C, and D have incorrect syntax for using MapTo() and are not the appropriate way to connect the SPA component to its AEM equivalent.
Therefore, the correct code to connect the SPA component called ItemList to its AEM equivalent is Option A: (‘project/components/content/itemList’).MapTo(ItemList, ItemListEditConfig);
Adobe Experience Manager Sites Developer Expert AD0-E134 certification exam practice question and answer (Q&A) dump with detail explanation and reference available free, helpful to pass the Adobe Experience Manager Sites Developer Expert AD0-E134 exam and earn Adobe Experience Manager Sites Developer Expert AD0-E134 certification.