一个简单的路障。我需要在我的一些服务中使用 Leaflet 和 Leaflet-Draw 插件。
我不知道如何导入完整的模块(核心和插件)
// the core
import * as L from 'leaflet';
// extension
import 'leaflet-draw';
export class LeafletConsumerService {}
我有一个我不太喜欢的解决方案。我通过硬链接加载库,index.html
消费者只需对类型文件有一个引用声明
/// <reference path="../typings/index.d.ts" />
export class LeafletConsumerService {}
我没有其他方法可以做到这一点吗?有没有办法导入一个只会对已加载模块产生副作用的文件?