Featuring examples of using TypeScript with Web AppBuilder for ArcGIS
Featuring examples of using TypeScript with Web AppBuilder for ArcGIS.
There are 2 types of project examples in this repository, one if you want to use and test your custom widgets within a running version of Web AppBuilder (see builder
section below) and one example of if you're developing a widget for a particular app (see developer
section below).
builder
Example using TypeScript and Grunt to copy files to your local Web AppBuilder Developer Edition so you can use your custom widgets in the builder interface. We have options for 2D Web AppBuilder apps (that use the ArcGIS API for Javascript v3.x) and 3D Web AppBuilder apps (that use the the ArcGIS API for JavaScript 4.x). This is the template that the generator-esri-appbuilder-js now outputs if you choose "TypeScript". More info here.
/builder
folder to your GitHub repo.Gruntfile.js
to point to your running Web AppBuilder instance.npm install -g grunt-cli
(see https://gruntjs.com/getting-started)npm install
grunt
developer
If you're not using the builder interface, this version extracts Web AppBuilder, copies the config files for your app, builds your widgets, and hosts the files. This workflow is less common, but can get you running quicker and easier.
npm install -g grunt-cli
(see https://gruntjs.com/getting-started)arcgis-web-appbuilder-2.16.zip
into the developer/
folder, right at the same level as the Gruntfile.js
.developer
foldernpm install
grunt init
Run grunt
and as you modify your files, the web app (in the dist
folder - serve via a web server like IIS or use serve) should be updated automatically.
A few notes about the general ideas and principles that are used in both the builder
and developer
versions of this code