【发布时间】:2016-12-15 10:58:20
【问题描述】:
一个简单的路障。我需要在我的一些服务中使用 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 {}
没有其他方法可以做到这一点吗?有没有办法导入一个只会对已加载的模块产生副作用的文件?
【问题讨论】:
标签: angular typescript import leaflet leaflet.draw