私は角度2で単純なアプリケーションを使用しています。データをページテーブルに表示します。私はthis example非常にいいと私のアプリで使用したいと思います。角度2のアプリケーションにdataTableを含めるにはどうすればよいですか?
<link rel="stylesheet" href="https://cdn.datatables.net/1.10.15/css/jquery.dataTables.min.css">
<link rel="stylesheet" href="https://cdn.datatables.net/select/1.2.2/css/select.dataTables.min.css">
例の
html
は次のようindex.html
のスクリプトである、home.component.html
で例
css
あります210私はこれを動作させるためにJavaスクリプトコードをどこに置くべきか知りたい。
index.html
とhome.compose.html
を入れようとしましたが、正しく動作しませんでした。Javaスクリプトのコードがどこにあるのか教えてください。 ありがとうございます。 これはjavascriptのである:
$(document).ready(function() { $('#example').DataTable({ columnDefs: [ { orderable: false, className: 'select-checkbox', targets: 0 } ], select: { style: 'os', selector: 'td:first-child' }, order: [[ 1, 'asc' ]] }); });
[Angular2でのjQueryを使用する方法は?]すでにこの上の合理的なリソースであるように思わ(http://stackoverflow.com/questions/30623825/how-to-use-jquery-with-angular2) –