title: Cannot find name 'headers'. in angular 2
body: <p><a href="http://i.stack.imgur.com/JDYSY.png" rel="nofollow">enter image description here</a>
  I am working on angular 2.this is my ts file I called getRandomQuote() method in constructor.
  But when i run the project i get below error:-<br>
  Cannot find name 'headers'. Did you mean the instance member 'this.headers'?</p>
  
  <pre><code>import {Component, ViewEncapsulation, Injectable} from '@angular/core';
  import {PaginatePipe, PaginationControlsCmp, PaginationService} from 'ng2-pagination';
  import { Http, Response, Headers,RequestOptions } from 'angular2/http';
  import {BasicTablesService} from './basicTables.service';
  import {BaCard} from '../../../../theme/components';
  import {HoverTable} from './components/hoverTable';
  import {BorderedTable} from './components/borderedTable';
  import {CondensedTable} from './components/condensedTable';
  import {StripedTable} from './components/stripedTable';
  import {ContextualTable} from './components/contextualTable';
  import {ResponsiveTable} from './components/responsiveTable';
  
  import {AuthHttp, AuthConfig, AUTH_PROVIDERS } from 'angular2-jwt';
  import {HTTP_BINDINGS} from 'angular2/http';
  
  
  
  @Component({
    selector: 'basic-tables',
    viewProviders: [PaginationService],
    pipes: [PaginatePipe, ResponsiveTable, ContextualTable],
  
    encapsulation: ViewEncapsulation.None,
    directives: [BaCard, HoverTable, BorderedTable, CondensedTable, StripedTable, ContextualTable, ResponsiveTable, PaginationControlsCmp,HTTP_BINDINGS],
    styles: [require('./basicTables.scss')],
    template:  `
  
  &lt;todo-search&gt;&lt;/todo-search&gt;
  
  &lt;table class="table table-hover"&gt;
  
  &lt;div &gt;Enter ID: &lt;input type="text" #listFilter (keyup)="0" style="color:black"  /&gt;&lt;/div&gt; &lt;div&gt;Alert on click&lt;button (click)="clicked()" style="color:black"&gt;Click&lt;/button&gt;&lt;/div&gt;
  &lt;span&gt;{{ test }}&lt;/span&gt;
      &lt;tr class="black-muted-bg"&gt;
  
        &lt;th class="align-left"&gt;ID&lt;/th&gt;
        &lt;th class="align-left"&gt;Name&lt;/th&gt;
        &lt;th class="align-left"&gt;Protocol&lt;/th&gt;
        &lt;th class="align-left"&gt;Inbound Business Process&lt;/th&gt;
        &lt;th class="align-left"&gt;Outbound Business Process&lt;/th&gt;
  
      &lt;/tr&gt;
          &lt;tbody&gt;
            &lt;tr *ngFor="let item of randomQuote  | paginate: { itemsPerPage: 20, currentPage: p } | ResponsiveTable:listFilter.value "&gt;
          &lt;td&gt;{{item.connectionId}}&lt;/td&gt;
         &lt;td&gt;{{item.name}}&lt;/td&gt;
          &lt;td&gt;{{item.protocol}}&lt;/td&gt;
          &lt;td&gt;{{item.inBoundBPName}}&lt;/td&gt;
           &lt;td&gt;{{item.outBoundBPName}}&lt;/td&gt;
  
  
      &lt;/tr&gt;
  &lt;/tbody&gt;
          &lt;pagination-controls (pageChange)="p = $event" #api&gt;&lt;/pagination-controls&gt;
      &lt;/table&gt;
  
    `,
    providers: [BasicTablesService]
  })
  export class BasicTables {
  
  
  
  
      public body = JSON.stringify(
      {
      "startIndex": 0,
      "numofIds": 15,
      "programId": null,
      "emailId":"admin@justransform.com",
      "searchStr":"",
      "transactionId":"",
      "status":"",
      "srcConnectionName":"",
      "destConnectionName":"",
          "inBoundBPName":"",
          "outBoundBPName":"",
          "fileContent":""
       }
  
  );
  
      public headers = new Headers({ 'Content-Type': 'application/json' });
      public options = new RequestOptions({ headers: headers }); 
      private url = 'http://uat.justransform.com:8080/justransform/transaction/find?sortByColumn=transactionId&amp;sortByOrder=Desc';
  
  
  
  
    randomQuote:Array&lt;any&gt; = [];
  getRandomQuote() {
    this.http.post(this.url, this.body, this.options)
      .map((res:Response) =&gt; res.json())
      .subscribe(  
        data =&gt; {this.randomQuote = data},
        err =&gt; this.logError(err), 
        () =&gt; console.log('Random Quote Complete')
  
      );
  
  } 
  
  logError(err) {
    console.error('There was an error: ' + err);
  }
    clicked(event) {
    alert("Alert");
  
    }
  
  
    constructor(public http: Http) {
  
    this.getRandomQuote();
  
    }
  }
  </code></pre>