I'm using angular's httpClient, and trying to use proper typescript typing, but I'm doing something wrong. The following code gives me an error
this.httpClient
.post(this.loginUrlRoute, params)
.pipe(
retry(3),
catchError(this.handleError.bind(this))
)
.subscribe((response: { url: string}) => {
Office.context.ui.displayDialogAsync(response.url);
});
[ts]
Argument of type '(response: { url: string; }) => void' is not assignable to parameter of type '(value: Object) => void'. Types of parameters 'response' and 'value' are incompatible. Type 'Object' is not assignable to type '{ url: string; }'. The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead? Property 'url' is missing in type 'Object'. [2345]
If I change it to response: object... then it complains that
" Property 'url' does not exist on type 'object'."
What is the correct way of doing this?