在Angular 2应用程序中的Jquery Datatable
问题描述:
我想在我的角度2应用程序中导入Metronic数据表,我在主html页面中导入所有脚本和引用(与html标记<script>..</script>
和<link>
),在我初始化角2(与System.import()
..),但它不工作,它显示我没有搜索/重新排序功能的表。 有什么建议吗?我怎样才能导入这些角2? 在此先感谢在Angular 2应用程序中的Jquery Datatable
<script src="/core-js/client/shim.min.js"></script>
<script src="/zone.js/dist/zone.js"></script>
<script src="/systemjs/dist/system.src.js"></script>
<script src="systemjs.config.js"></script>
<script>
System.import('main.js').catch(function(err){ console.error(err); });
</script>
<link href="/theme2/global/plugins/datatables/datatables.min.css" rel="stylesheet" type="text/css" />
<link href="/theme2/global/plugins/datatables/plugins/bootstrap/datatables.bootstrap.css" rel="stylesheet" type="text/css" />
<script src="/theme2/global/scripts/datatable.js" type="text/javascript"></script>
<script src="/theme2/global/plugins/datatables/datatables.min.js" type="text/javascript"></script>
<script src="/theme2/global/plugins/datatables/plugins/bootstrap/datatables.bootstrap.js" type="text/javascript"></script>
答
尝试在.angular-cli.json导入库文件
{
"scripts": [/themes/..*.js],
}
此外,确保如果能使用NPM安装包安装库。
谢谢,我没有任何angular-cli.json,我应该使用它吗? – Ale
你是如何创建你的应用的?标准方法是使用angular-cli和npm环境。 – aRise
我在角度https://angular.io/docs/ts/latest/quickstart.html中使用快速入门指南,现在我注意到它是一个角度快速启动,但我不知道它是什么。 – Ale