-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Overridden Model
methods have incorrect this
type
#9404
Comments
|
Reproduction
Example: https://github.com/seanCodes/ember-data-bugs/blob/main/app/models/user.ts#L11
Repo: seanCodes/ember-data-bugs
Description
When overriding base
Model
methods (save
,deleteRecord
,serialize
) in a custom model, methods/properties on the custom model can’t be accessed—according to TypeScript—when in reality (when the code is run) they can.This seems to be caused by
this
in the overridden method being a genericModelInstance
rather than an actual instance of the custom model. From what I can tell there's no way to change this, since the overridden method needs the same signature as the base method:Versions
The text was updated successfully, but these errors were encountered: