Skip to content
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

Property 'closable' is incompatible with index signature. #382

Open
hakkikonu opened this issue Nov 13, 2023 · 4 comments
Open

Property 'closable' is incompatible with index signature. #382

hakkikonu opened this issue Nov 13, 2023 · 4 comments
Assignees

Comments

@hakkikonu
Copy link

Error: node_modules/ngx-smart-modal/lib/components/ngx-smart-modal.component.d.ts:154:94 - error TS2344: Type '{ closable: { alias: "closable"; required: false; }; escapable: { alias: "escapable"; required: false; }; dismissable: { alias: "dismissable"; required: false; }; identifier: { alias: "identifier"; required: false; }; ... 10 more ...; refocus: { ...; }; }' does not satisfy the constraint '{ [key: string]: string; }'.
  Property '"closable"' is incompatible with index signature.
    Type '{ alias: "closable"; required: false; }' is not assignable to type 'string'.

versions:

  • "ngx-smart-modal": "^14.0.3",
  • "@angular/core": "^15.2.10",
  • "typescript": "4.9.5"

usage:

<ngx-smart-modal [closable]="false"> </ngx-smart-modal>

I think it's related to TypeScript's type-checking. It seems like the issue is with the type definition in the NgxSmartModalComponent. The error message suggests that the properties closable, escapable, dismissable, etc., in the component declaration do not satisfy the expected type constraint.

@hakkikonu hakkikonu changed the title Property '"closable"' is incompatible with index signature. Property 'closable' is incompatible with index signature. Nov 13, 2023
@maximelafarie maximelafarie self-assigned this Nov 16, 2023
@maximelafarie
Copy link
Owner

Thank you for reporting this issue @hakkikonu. I've got this!

@artbat
Copy link

artbat commented Dec 13, 2023

With the same versions as @hakkikonu, Angular seems to expect a simpler signature for this config:

image

@gregorygregio
Copy link

Got the same issue. Is there a workaround available?

@pepas24
Copy link

pepas24 commented Jan 18, 2024

@gregorygregio for me the only solution to use 14.0.3 was to copy the code to my app, because I think the problem is that the last version was compiled with Angular 16
#383 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants