-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed
Labels
TSIssues and PRs related purely to TypeScript issuesIssues and PRs related purely to TypeScript issueshelp wantedIssues we wouldn't mind assistance with.Issues we wouldn't mind assistance with.
Description
John Lindquist reported that
import {Observable} from 'rxjs/Rx.DOM';
Observable.ajax('http://swapi.co/api/people/1/')
.subscribe();
gives TS compile error
ERROR in ./src/main.ts
(2,1): error TS2346: Supplied parameters do not match any signature of call target.
Solution suggestion:
I think the type signature should be changed like this:
export interface AjaxCreationMethod {
- (): <T>(urlOrRequest: string | AjaxRequest) => Observable<T>;
+ <T>(urlOrRequest: string | AjaxRequest): Observable<T>;
get: <T>(url: string, resultSelector?: (response: AjaxResponse) => T, headers?: Object) => Observable<T>;
post: <T>(url: string, body?: any, headers?: Object) => Observable<T>;
put: <T>(url: string, body?: any, headers?: Object) => Observable<T>;
delete: <T>(url: string, headers?: Object) => Observable<T>;
getJSON: <T, R>(url: string, resultSelector?: (data: T) => R, headers?: Object) => Observable<R>;
}
Metadata
Metadata
Assignees
Labels
TSIssues and PRs related purely to TypeScript issuesIssues and PRs related purely to TypeScript issueshelp wantedIssues we wouldn't mind assistance with.Issues we wouldn't mind assistance with.