0
我试图在组件模板中添加jquery onclick事件,例如, app.component.html在angualr2组件模板中添加jquery
<li>
<a id="menu-close" href="#services">Services</a>
</li>
和我在一个custom.js写了一个函数文件如
$("#menu-close").click(function(e) {
....
}
但我不知道如何加载custom.js,只是添加
<script src="js/custom.js"></script>
index.html中?
当你使用'angular'你不需要'jquery'。尝试在'html'中实现像ng-click这样的角度选项。也加载'custom.js'为你的'js'文件 –