Select to view content in your preferred language

WAB Custom Widget Code in External *.js file

528
2
08-11-2020 03:06 PM
Arne_Gelfert
Regular Contributor

If I'm wanting to modify/build on an existing WAB widget but keep my custom code in a separate file from the existing widget's widget.js, would it be common practice to put it in Utils.js, and do something like ...

define([
   ...,
    './Utils',
    ...
], function(..., myUtils,
...) {

myUtils.foo(...)‍‍‍‍‍‍‍‍;

}‍‍‍‍‍‍‍‍‍‍

... to access any methods defined in Utils.js?

I've seen use of Utils.js but haven't had a need to ask what it's doing, so I could be completely wrong. Learning Javascript a mountain building speed. 

0 Kudos
2 Replies
RobertScheitlin__GISP
MVP Emeritus

Arne,

   You are on the right track there.

Arne_Gelfert
Regular Contributor

Thanks, Robert - as always!