This is used as a custom resolver on the route you want to load the JS API modules on as per https://blog.thoughtram.io/angular/2016/10/10/resolving-route-data-in-angular-2.html.
you can then access the modules by injecting ActivatedRoute
into your component and looking at this.route.snapshot.data['esri']['Map']
.
import { NgModule } from "@angular/core";
import { Routes, RouterModule } from "@angular/router";
import { EsriModuleResolveService } from "./esri-module-resolve.service";
import { MapViewComponent } from "./map-view.component";