Skip to content
This repository was archived by the owner on Apr 9, 2018. It is now read-only.

Commit 74ee555

Browse files
add loading of module into usage section
1 parent 4f0a000 commit 74ee555

File tree

1 file changed

+29
-3
lines changed

1 file changed

+29
-3
lines changed

README.md

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,40 @@ For Angular 2:
1818
npm install angular2-esri-loader esri-loader
1919
```
2020

21-
**NOTE**: for Angular.js use [angular-esri-map](https://github.com/Esri/angular-esri-map).
21+
**NOTE**: for AngularJS use [angular-esri-map](https://github.com/Esri/angular-esri-map).
2222

2323
## Usage
24-
Example of using the loader service in a component to lazy load the ArcGIS API and create a map
24+
25+
Below is an example of using the loader service in a component to lazy load the ArcGIS API and create a map.
26+
27+
First you need to import the `EsriLoaderModule` into your application:
2528

2629
```ts
27-
import { Component, OnInit, ViewChild, ElementRef } from '@angular/core';
30+
import { BrowserModule } from '@angular/platform-browser';
31+
import { NgModule } from '@angular/core';
32+
import { EsriLoaderModule } from 'angular-esri-loader';
33+
34+
import { AppComponent } from './app.component';
35+
import { EsriMapComponent } from './esri-map.component';
36+
37+
@NgModule({
38+
declarations: [
39+
AppComponent,
40+
EsriMapComponent
41+
],
42+
imports: [
43+
BrowserModule,
44+
EsriLoaderModule,
45+
],
46+
bootstrap: [AppComponent]
47+
})
48+
export class AppModule { }
49+
```
50+
51+
Then you can use the `EsriLoaderService` in a component to load a map:
2852

53+
```ts
54+
import { Component, OnInit, ViewChild, ElementRef } from '@angular/core';
2955
import { EsriLoaderService } from 'angular-esri-loader';
3056

3157
@Component({

0 commit comments

Comments
 (0)