Generic type 'Observable<T>' requires 1 type argument

theDataSource: Observable<any>;

where any can (or should be if possible) be a more concrete type that matches the type of the values it is supposed to emit.


If you look in source of Angular Http module you can find method request of Http class

https://github.com/angular/angular/blob/2.4.1/modules/%40angular/http/src/http.ts#L111

All other methods (get, post, etc. ) wrap this request. Also you can see that request returns an Observable with generic of Response class. Response class is a part of Http module, so your code can be modified to this:

import { HttpModule, Http, Response } from '@angular/http';
...
theDataSource: Observable<Response>;

Or, if you do not need this strong typification you can pass any as parameter of generic

theDataSource: Observable<any>;

But in my opinion - strong typification is better choice.


1) theDataSource: Observable; -> theDataSource: Observable<any>;

2/3) you can add "noImplicitAny": false to your tsconfig.json

or change data => and err => with (data: any) => and (err: any) =>