but when the panel is loaded in back office, inside the panel
I get
Uncaught ReferenceError: angular is not defined
I tried by adding <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.min.js"></script>
I get this error: Uncaught Error: No module: LitiumApp
below is the error when I remove reference to angular
ReferenceError: angular is not defined↵ at eval (eval at <anonymous> (http://nf-se6.spotonsolutions.se/Litium/Common/ModulePanelContainer.aspx?ModuleArea=ProductArea&ModulePanelID=b24c243d-e14d-4d16-bfbd-26752ac0e180:4:14), <anonymous>:1:1)↵ at http://nf-se6.spotonsolutions.se/Litium/Common/ModulePanelContainer.aspx?ModuleArea=ProductArea&ModulePanelID=b24c243d-e14d-4d16-bfbd-26752ac0e180:101:14"
It can also have a dependency on the order the script is loaded so maybe you also need to add some lazy initialization on your code so the Litium application have possibility to start first.
but still the same errors.
This is the issue inside the panel I created, if I inspect element the left section of the litium bakoffice and
check for
angular.module(‘LitiumApp’);
it returns the right module.
The module panel is loaded in an iframe, that is the reason that you not have access to the product created angularjs modules.
I think it is easier to get it working with the iframe-dialog that @ton.nguyen was suggesting in Use dialogs in backoffice then getting it to work between the frames in the current window.
could you please provide some more documentation regarding the
Customers and Media (Angular) part, or any sample code implementation for the same.
it would great help for me.
Thanks.
Ok, then the best solution is to the iframe to load those dialogs, as Patric pointed this link: Use dialogs in backoffice
Try to open this link: https://[websiteurl]/Litium/UI/frame/EntitySelectorWrapper?entityType=file (remember to change websiteurl as the domain name of your site) then you will see the dialog to select media file.
Change the entityType to page to have a dialog to select page.
You don’t pass the callback function, you listen for the event as I wrote in the other post:
To catch the data when user selects an item and clicks on Ok button, have this JS snippet in your user control:
function onSelect(event) {
if (event.data.source !== "entityselector")
return;
var selectedPersons = event.data.value.items;
}
window.addEventListener("message", onSelect, false);
What it does is, listen to the onMessage event of the iframe, and get the selected person. selectedPersons is an array which contains the list of selected persons. Each item has a Name and a SystemId.
My apologize, Page and File cannot be selected by using EntitySelectorWrapper. Other Url should be used:
Basically the idea of the host an iFrame in the page and listen for the event when the OK or Cancel button is clicked. Here are the list of URL:s should be set in the SRC attribute of the iFrame: