I am a newcomer to Angular2, created using Cli. While I successfully imported Leaflet into my Angular2 project without any Angular2 directives, I am struggling to do the same with the Leaflet Draw extension. I haven't been able to make Draw work. In essence, I want to import a module that extends another within the same namespace, in this case, Leaflet. Does anyone know how to achieve this?
Below is my package.json:
{
"name": "amscm-web",
"version": "2.0.31c",
"license": "",
// more configuration details here...
}
Additionally, here is my map.model.ts file:
import * as L from 'leaflet';
import 'leaflet.draw';
export class LeafletMapModel {
constructor(
public baseLayers: {
id: string,
name: string,
enabled: boolean,
layer: L.Layer
}[],
public baseLayer: string,
public overlayLayers: {
id: string,
name: string,
enabled: boolean,
layer: L.Layer
}[] = []
) { }
}