title: Cannot find name '$' in component.ts
body: <p>I got error:'Cannot find name '$' in component' on compile time of angular web-app. When i used <code>const $ : any = '';</code> then solved error but getting a another error in browsers console: 'core.js:1440 ERROR TypeError: $ is not a function' and also datatable not working when used <code>const $ : any = '';</code>.     </p>
  
  <p>Below is my code of users component. This component is used for list of users into datatable.</p>
  
  <p>users.component.ts</p>
  
  <pre><code>import {DataService} from './../services/data.service';
  import {Component, OnInit} from '@angular/core';
  import {API_ENDPOINT} from '../app.module';
  import {Response} from '@angular/http/src/static_response';
  
  
  const $: any = '';
  
  @Component({
      selector: 'app-users',
      templateUrl: './users.component.html',
      styleUrls: ['./users.component.css']
  })
  export class UsersComponent implements OnInit {
  
      private url = API_ENDPOINT + '/admin_api/users';
      private users: any;
  
      constructor(private dataService: DataService) {
      }
  
      ngOnInit() {
          this.dataService.get(this.url)
              .subscribe(responce =&gt; {
                  this.users = responce.data.users;
                  if (this.users) {
                      setTimeout(function () {
                          var oTable1 = $('#sample-table-2').dataTable({
                              "aoColumns": [
                                  {"bSortable": false},
                                  null, null, null, null, null,
                                  {"bSortable": false}
                              ],
                          });
                      }, 3000);
                  }
              })
      }
  }
  </code></pre>