Mobile Apps - Component referred using reference component - JSON not set in scope

Avatar

Avatar

sandeepk7656774

Avatar

sandeepk7656774

sandeepk7656774

27-09-2016

Mobile Apps based implementation provides ability to integrate angular with AEM and to pass data to angular scope from AEM using angular.json.jsp and controller.js.jsp. When I am using this as standalone component and dragging to page which is based on angular template. The JSON created in angular.json.jsp is successfully read in controller.js.jsp with "frameworkType=angular"

When this component is authored in a separate page, in another page trying to use this inside reference component, the angular.json.jsp, controller.js.jsp is not coming to picture at all.

I had a use case to author the JSON structure (to be passed to angular scope) in one place, then use in all pages using reference component. Any pointers would be helpful

View Entire Topic

Avatar

Avatar

Bruce_Lefebvre

Employee

Avatar

Bruce_Lefebvre

Employee

Bruce_Lefebvre
Employee

29-09-2016

Hi Sandeep,

The best recommendation I can offer at this point is to create an extension of the /libs/foundation/components/reference component that includes the cq:template node specifying frameworkType: angular, and supports proxying angular.json and controller.js requests to the "referenced" resource. I hacked together an example component to prove this out:

Mobile reference component example · GitHub

Hope this helps,

Bruce