I am learning Angular 2, and I am having problems with a service that will return an observable.
I see this error, but not sure why? I am trying to follow some tutorials that I found on the Internet ...
[ts] The parameter "observer" is implicitly of type "any".
My editor highlights the work of the "observer" at the beginning of the lambda.
I am using Angular "2.0.0-rc.2"
import { Injectable } from '@angular/core'; import { Observable } from 'rxjs/Observable'; @Injectable() export class LocationService { constructor() { } getLocation(): Observable<string> { let data: Observable<string>; data = new Observable<string>(observer => { observer.next("123") }); return data; } }
angular
Ben cameron
source share