title: How to include dataTable to angular 2 application?
body: <p>I have a simple application in angular 2. I want to display data in a paginated table. I found <a href="https://datatables.net/extensions/select/examples/initialisation/checkbox.html" rel="nofollow noreferrer">this example</a> very nice and I would like to use in my app. </p>
  
  <ul>
  <li><p>The<code>html</code> of the example is in <code>home.component.html</code>,</p></li>
  <li><p>The <code>css</code> of the example is in script in <code>index.html</code> like:</p></li>
  </ul>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>    &lt;link rel="stylesheet" href="https://cdn.datatables.net/1.10.15/css/jquery.dataTables.min.css"&gt;
      &lt;link rel="stylesheet" href="https://cdn.datatables.net/select/1.2.2/css/select.dataTables.min.css"&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>I want to know where I should put the java script code for this to work. I have tried to put in <code>index.html</code> and <code>home.compose.html</code>, but none on this worked correctly. </p>
  
  <p>Please tell me where the java script code should go. 
  Thank.
  This is the javascript:</p>
  
  <pre><code>$(document).ready(function() {
      $('#example').DataTable( {
          columnDefs: [ {
              orderable: false,
              className: 'select-checkbox',
              targets:   0
          } ],
          select: {
              style:    'os',
              selector: 'td:first-child'
          },
          order: [[ 1, 'asc' ]]
      } );
  } );
  </code></pre>