Skip to content

Latest commit

 

History

History
65 lines (37 loc) · 2.75 KB

README.md

File metadata and controls

65 lines (37 loc) · 2.75 KB

ArcGIS API for JavaScript with Angular CLI

This repo demonstrates how to use @arcgis/core ES modules with Angular 13.


Known issues

  • There is an optimization bug affecting production builds at Angular 12.2.x. It is recommended to use Angular 12.1.x or upgrade to Angular 13. For more information: Esri/feedback-js-api-next#131.

  • If you are seeing 404 errors in the console after updating Angular 12.1.x dependencies, you should try clearing your browser cache. This is an Angular caching issue.

  • To prevent Unhandled Promise Rejection errors when using Angular with Zone.js, upgrade to Angular 13, Zone.js 0.11.4or greater, and switch the tsconfig.target to es2017 or greater.

  • If you are seeing CommonJS or AMD dependency warnings you can supress them in your build output through a property setting in angular.json, this won't affect functionality. Also, consider upgrading by running npm i @arcgis/core@latest.

angular.json

  "allowedCommonJsDependencies": [
    "moment"
  ],

Get Started

Step 1 - Run npm install and then start adding modules.

Step 2 Configure CSS.

styles.css

  @import 'https://js.arcgis.com/4.22/@arcgis/core/assets/esri/themes/light/main.css';

For additional information, see the Build with ES modules Guide topic in the SDK.

Requirements

  • If you are using Zone.js, the minimum version is 0.11.4 (February 10, 2021) or greater.

TypeScript

Currently, due to limitations in TypeScript, the APIs autocasting functionality works best in non-TypeScript applications. No changes are required if you are already using the API without any TypeScript build errors.

This sample implements strict class initalization, for more information visit the TypeScript documentation page.

Minimum required version is ~4.4.2.

Commands

For a list of all available npm commands see the scripts in package.json.

Development server

Run ng serve --open for a dev server that will automatically open a browser window. The app will automatically reload if you change any of the source files. You need to install Angular CLI before you can compile the app.

Build

Run ng build to build the project. The build artifacts will be stored in the dist/ directory.

Further help

To get more help on the Angular CLI use ng help or go check out the Angular CLI README.