-
Clone the starter repo AngularClass/angular2-webpack-starter and then
cdinto your local directory. -
Install angular2-esri-loader
npm install angular2-esri-loader --save
# optional, if you want type support in your IDE for JSAPI 4.x
npm install @types/arcgis-js-api --save-dev- Add the following
importstatements to the bottom of your application's module:
import { EsriLoaderService } from 'angular2-esri-loader';
import { EsriMapComponent } from './esri';- Add the following to your application's
declarations(you'll make a new mapping component soon):
EsriMapComponent- Add the following to your application's
providersto register angular2-esri-loader'sEsriLoaderService:
EsriLoaderService- Create a new component that uses the
EsriLoaderServiceto show a map
- see
esri.component.tsandesri.component.cssbelow
- Optional: Create a new route in your application if needed
- see example
app.routes.tsbelow