Hello Everyone,
We are currently using ember-cli-typescript along on the frontend of our application. When implementing a loading substate as detailed here, typescript reports:
app/routes/loading.ts:10:19 - error TS2769: No overload matches this call.
Overload 1 of 2, '(key: "toString" | "get" | "getProperties" | "set" | "setProperties" | "notifyPropertyChange" | "addObserver" | "removeObserver" | "getWithDefault" | "incrementProperty" | "decrementProperty" | ... 16 more ... | "actions", value: any): any', gave the following error.
Argument of type '"currentlyLoading"' is not assignable to parameter of type '"toString" | "get" | "getProperties" | "set" | "setProperties" | "notifyPropertyChange" | "addObserver" | "removeObserver" | "getWithDefault" | "incrementProperty" | "decrementProperty" | ... 16 more ... | "actions"'.
Overload 2 of 2, '(key: "toString" | "get" | "getProperties" | "set" | "setProperties" | "notifyPropertyChange" | "addObserver" | "removeObserver" | "getWithDefault" | "incrementProperty" | "decrementProperty" | ... 16 more ... | "actions", value: true): true', gave the following error.
Argument of type '"currentlyLoading"' is not assignable to parameter of type '"toString" | "get" | "getProperties" | "set" | "setProperties" | "notifyPropertyChange" | "addObserver" | "removeObserver" | "getWithDefault" | "incrementProperty" | "decrementProperty" | ... 16 more ... | "actions"'.
10 controller.set('currentlyLoading', true);
Why is this?
I imagine typescript can’t find the currentlyLoading symbol/overload, from the error message , but how do I instruct typescript on where to find this symbol/overload?
I should note that even though typescript is reporting an error, the substate displays correctly when a route is in transition.