Angular2 'this' is undefined
<p>I have a code that looks like this:</p>

<pre><code>export class CRListComponent extends ListComponent&lt;CR&gt; implements OnInit {

    constructor(
        private router: Router,
        private crService: CRService) {
        super();
    }

    ngOnInit():any {
        this.getCount(new Object(), this.crService.getCount);
    }
</code></pre>

<p>The ListComponent code is this</p>

<pre><code>@Component({})
export abstract class ListComponent&lt;T extends Listable&gt; {

    protected getCount(event: any, countFunction: Function){
        let filters = this.parseFilters(event.filters);
        countFunction(filters)
            .subscribe(
                count =&gt; {
                    this.totalItems = count;
                },
                error =&gt; console.log(error)
            );
    }
</code></pre>

<p>And the appropriate service code fragment from CRService is this:</p>

<pre><code>getCount(filters) {
    var queryParams = JSON.stringify(
        {
            c : 'true',
            q : filters
        }
    );

    return this.createQuery(queryParams)
        .map(res =&gt; res.json())
        .catch(this.handleError);
}
</code></pre>

<p>Now when my <code>ngOnInit()</code> runs, I get an error:</p>

<blockquote>
  <p>angular2.dev.js:23925 EXCEPTION: TypeError: Cannot read property
  'createQuery' of undefined in [null] </p>
  
  <p>ORIGINAL EXCEPTION:
  TypeError: Cannot read property 'createQuery' of undefined</p>
</blockquote>

<p>So basically, the <code>this</code> in the <code>return this.createQuery(queryParams)</code> statement will be null. Does anybody have an idea how is this possible?</p>