This repository was archived by the owner on Apr 9, 2018. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +29
-3
lines changed Expand file tree Collapse file tree 1 file changed +29
-3
lines changed Original file line number Diff line number Diff line change @@ -18,14 +18,40 @@ For Angular 2:
18
18
npm install angular2-esri-loader esri-loader
19
19
```
20
20
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 ) .
22
22
23
23
## 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:
25
28
26
29
``` 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:
28
52
53
+ ``` ts
54
+ import { Component , OnInit , ViewChild , ElementRef } from ' @angular/core' ;
29
55
import { EsriLoaderService } from ' angular-esri-loader' ;
30
56
31
57
@Component ({
You can’t perform that action at this time.
0 commit comments