0

I have a working $http service written in Typescript with that the Webstorm Typescript file watcher is complaining about. Here is the line of code

File Watcher Error

When I hover over "this" or go to the transpiler window the error is

Error:(14, 20) TS2322: Type 'IPromise<void>' is not assignable to type 'IHttpPromise<IScheduleDay[]>'.
  Property 'success' is missing in type 'IPromise<void>'.

I don't understand where IPromise<any> is coming from. Any idea what I can do to get rid of this squiggle?

1 Answer 1

1

I don't understand where IPromise<any> is coming from

From the inferred return value of catch.

TIP : Split the line get().then().catch() into three variables to see the types flow between them

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.