Can I include js files in my Widget.html?

938
2
10-20-2017 06:10 AM
Labels (1)
JuanOropeza
New Contributor III

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?

2 Replies
CristinaRomeroCalvo
New Contributor

Did you manage to figure out where to place the script src inside web app builder? I am having the same issue.

0 Kudos
diaconori
New Contributor III

Im also interested in knowing this. 

0 Kudos