This repository has been archived by the owner on Jan 30, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 87
Cannot set namespace
in TypeScript subclass
#393
Labels
Bug
Issue relates to a problem in the `ember-ajax` codebase
Comments
Thanks for the report! I'll definitely look into this |
alexlafroscia
added
the
Bug
Issue relates to a problem in the `ember-ajax` codebase
label
Oct 10, 2018
@pepke41 and I have been looking into this some and plan to fix it in a coming release. The But I think we can use the |
This looks fixed. Isnt it? |
Just ran into this issue today. I'm currently getting the same error with @computed()
get trustedHosts() {
return [/\.somedomain/];
}
get headers() {
const headers: Headers = {
Accept: 'application/vnd.api+json',
'Content-Type': 'application/vnd.api+json',
};
// ...
return headers;
} I've added the different return types combinations above and my own types but I still see the same error. |
This has been fixed in 2e2b0c5, but hasn't been released yet. |
I'm experiencing this problem as well. Is it possible to publish the fix? |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I'm extending the AjaxService in TypeScript like this:
Which gives the following compilation error:
In the source the value of
namespace
is defined asundefined
:ember-ajax/addon/mixins/ajax-request.ts
Line 229 in f5d3245
This means it doesn't accept a value of
string
. To allow this, the type definition needs to look like this:There's a few additional instances like this (
headers
,host
,trustedHosts
) and possibly more.The text was updated successfully, but these errors were encountered: