Select to view content in your preferred language

How to use a polyfill when creating custom widget

543
1
05-18-2020 04:15 PM
NathanB
New Contributor II

At the risk of getting yelled at or standing in a corner with a dunce cap while people point an yell 'noob'.....i recently worked on a custom widget.  however, there are a lot of template strings in there.  however, IE 11 doesn't support template strings.  either i have to go back and remove every back tick or i can try to use a polyfill.

for example, i'd like to use: 

<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-polyfill/6.26.0/polyfill.min.js"/>

i'm not sure where to place it within the widget project.  does it go in the html file, etc.  i think i may have saw something similar in the doc but i don't remember.  thanks in advance
0 Kudos
1 Reply
HarishPalaniappan
New Contributor III

Adding polyfill to the resources array within your Web App Builder App.
An example here:
https://github.com/agrc/wfrc-wab-widgets

Details: https://gis.utah.gov/best-practices-for-building-web-appbuilder-widgets/

Or if you want to add custom libraries to a widget then add reference in the widget.js file.

An example here-

https://stackoverflow.com/questions/56567563/adding-custom-libraries-to-a-widget-in-arcgis-web-appab...

polyfill‌ #ajax#esri js 4.12

0 Kudos