I am really trying to understand how to correctly import a dependency into a component.
I have installed the Leaflet library and its typings into the project (packages.json snippet):
"@types/leaflet": "^1.0.38"
...
"leaflet": "^1.0.2"
@types/leaflet/index.d.ts exports:
declare module 'leaflet' {
export = L;
}
In my component file, get complaints for all:
import leaflet from 'leaflet';
//import L from 'leaflet';
export class AppComponent {
mymap = leaflet.map('mapid').setView([51.505, -0.09], 13);
}
Module ''leaflet'' has no default export.at line 3 col 8
What's the correct import statement? (I admit this is a big hole in my understanding of the angular cli / webpack / typescript / black hole)