-
Clone the starter repo AngularClass/angular2-webpack-starter and then
cd
into 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
import
statements 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
providers
to register angular2-esri-loader'sEsriLoaderService
:
EsriLoaderService
- Create a new component that uses the
EsriLoaderService
to show a map
- see
esri.component.ts
andesri.component.css
below
- Optional: Create a new route in your application if needed
- see example
app.routes.ts
below