You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have the following function in an Angular 4 service class:
public get(url: string): Promise<Response> {
return this._http.get(url).toPromise();
}
Note, that the get function returns an Observable, but this type name is not appearing in the code explicitly.
The .toPromise() function of Observable is imported in rxjs.imports.ts like this:
Yeah, the no-unused-variable rule misbehaves badly. It's had problems that have been 'fixed' before, but it's still broken in a way that affects other rules. It's a pity, as it's a useful rule. However, it's wasted so much of my time on previous occasions and is difficult to debug, so I just switch if off.
I have the following function in an Angular 4 service class:
Note, that the
get
function returns anObservable
, but this type name is not appearing in the code explicitly.The
.toPromise()
function ofObservable
is imported inrxjs.imports.ts
like this:And I have the following rule in
tslint.json
:This triggers the following error when running
tslint
, which seems to be a false alarm:Thank you for creating and maintaining this library, Nicholas!
György
The text was updated successfully, but these errors were encountered: