Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/28.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何在传单Angular2项目中使用外部JS库_Javascript_Angular_Leaflet - Fatal编程技术网

Javascript 如何在传单Angular2项目中使用外部JS库

Javascript 如何在传单Angular2项目中使用外部JS库,javascript,angular,leaflet,Javascript,Angular,Leaflet,我想在我的传单Angular 2项目中使用传单搜索插件,以便能够搜索地图上的对象。 这里是js插件 我的问题是,传单看不到搜索,例如,如果我尝试 L.Control.SearchI get类型控件上不存在搜索 我所尝试的: 在typings.d.ts中 declare var Search: any; 在index.html中 <script src="../node_modules/leaflet-search/dist/leaflet-search.src.js"> </

我想在我的传单Angular 2项目中使用传单搜索插件,以便能够搜索地图上的对象。 这里是js插件

我的问题是,传单看不到
搜索
,例如,如果我尝试
L.Control.Search
I get
类型控件上不存在搜索

我所尝试的:

typings.d.ts中

declare var Search: any;
index.html中

<script src="../node_modules/leaflet-search/dist/leaflet-search.src.js">
</script>
但它仍然不起作用。。。 我怎样才能修好它

import '../../../../node_modules/leaflet-search/dist/leaflet-search.src.js';