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
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:
Now this component (this has frameworkType=angular property) is dragged in angular based template. There JSON from angular.json.jsp is set to $scope. This works fine in normal page.
Now say if I have 3 pages (Page1, Page2, Page3).In page 1 I have mycomponent dragged. In Page2, Page3, I drag reference component (/libs/foundation/components/reference). In both pages I refer to mycomponent authored in Page1. But here the call is not made to controller.js.jsp (Prob because reference node is not having frameworkType=angular). I was trying to have json in one page and refer in other 2 pages.