2017-06-05 53 views
1

我想在我的角度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> 

回答

0

嘗試在.angular-cli.json導入庫文件

{ 
"scripts": [/themes/..*.js], 
} 

此外,確保如果能使用NPM安裝包安裝庫。

+0

謝謝,我沒有任何angular-cli.json,我應該使用它嗎? – Ale

+0

你是如何創建你的應用的?標準方法是使用angular-cli和npm環境。 – aRise

+0

我在角度https://angular.io/docs/ts/latest/quickstart.html中使用快速入門指南,現在我注意到它是一個角度快速啓動,但我不知道它是什麼。 – Ale

相關問題