Skip to Content
10
Dec 27, 2016 at 08:18 PM

Creating an AngularJS Widget in Backoffice

216 Views

Hello, I'm currently investigating how to develop an angular widget for backoffice. I thought the starting point would be this post: https://help.hybris.com/6.2.0/hcd/faa7eefeb6fa4cef9371035df5e7156d.html but working with Hybris 6.2 following the post or just downloading the zip, there's an issue with the angularCNG variable defined in angularwidget.js. It dones not find it and the error on JS console is: Can't find variable: AngularCNG in the line in which you define init method

 AngularCNG.init = function(widgetName, controller, services) {

I'm having some troubles to find the error since it's working on zk framework. I added the js-libraries.xml file with

 <libraries xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            xsi:noNamespaceSchemaLocation="http://www.hybris.com/schema/cockpitng/libraries.xsd">
 
     <library>
         <name>angular</name>
     </library>
 
 </libraries>
 

But there are no angular imports into the resources when backoffice loads up. I think the problem may be related with that.

If you have any thoughts or ideas related with this issue I would really appreciate it since the post in help.hybris is not functional.