future defining of usermodule required scripts/functions help
-
This will likely be a Jared question...
Using latest mangoUI system and have noticed you've moved to using ES6's import and export calls. At the moment I call everything I need with the define() method but seeing how some of my code involves expanding on some of the Amcharts code, I can no longer easily pull the references I need to make my code work...
Am I going to need to rejig userModule some time soon to use ES6? if so I may need some assistance with my code that uses maRequire to load component controllers on a per page basis...
Not quite in the mood for a complete overhaul of my code right at the moment... -
@mattfox said in future defining of usermodule required scripts/functions help:
At the moment I call everything I need with the define() method but seeing how some of my code involves expanding on some of the Amcharts code, I can no longer easily pull the references I need to make my code work...
User modules will still use AMD/RequireJS style require/define imports. You should be able to import most of the files which you may need. It was bought to my attention yesterday that this might not be the case with the PointValueController.js file, I will probably rejig this into an AngularJS service for easy injection. If you don't want to change anything I would suggest copying the version from the 3.3 branch - https://github.com/infiniteautomation/ma-dashboards/blob/3.3.x/UI/web/ngMango/directives/PointValueController.js
@mattfox said in future defining of usermodule required scripts/functions help:
Am I going to need to rejig userModule some time soon to use ES6?
No
-
@MattFox The UI module release v3.4.3 will have point value controller available as a service (maPointValueController).
See one of the directives in git for how to inject and use it -
https://github.com/infiniteautomation/ma-dashboards/blob/main/UI/web-src/ngMango/directives/indicator.js -
Thanks for doing this on such short notice Jared