AnsweredAssumed Answered

Can I include js files in my Widget.html?

Question asked by joropeza.ingeolan on Oct 20, 2017

I'm trying to create a custom Widget using the one already on WebAppBuilder.

 

So a basic example is create a `Widget.html` and works ok.

 

    <div>
        <div>${nls.label1}.</div>
       <div>${nls.label2}.[${config.configText}]</div>
       <div data-dojo-attach-point="mapIdNode"></div>
       <div data-dojo-attach-point="vertexCount"></div>
    </div>

I want to add some graphics on the Widget so try to include P5.js

 

 

<script src="libraries/p5.js" type="text/javascript"></script>

Now I get the following error:

 

Error: Invalid template: <script src="libraries/p5.js" type="text/javascript"></script>
<div>
<div>${nls.label1}.</div>
<div>${nls.label2}.[${config.configText}]</div>
<div data-dojo-attach-point="mapIdNode"></div>
<div data-dojo-attach-point="vertexCount"></div>
</div>

So can I add scripts to a Widget template? What about if want to include some AngularJS component?

Outcomes