angular2-esri-loader
An Angular 2 service to help you load ArcGIS API for JavaScript Modules
Install
npm install angular2-esri-loader esri-loader
Usage
Example of using the loader service in a resolver to lazy load the ArcGIS API and
import { Injectable } from '@angular/core';
import { Resolve } from '@angular/router';
import { EsriLoaderService } from 'angular2-esri-loader';
@Injectable()
export class EsriMapResolveService implements Resolve<any> {
constructor(private esriLoader: EsriLoaderService) { }
resolve() {
return this.esriLoader.load({
url: '//js.arcgis.com/3.18/'
}).then(() => {
return this.esriLoader.loadModules(['esri/map']);
});
}
}