maximelafarie / ngx-smart-modal

Modal/Dialog component crafted for Angular (Ivy-compatible)
https://maximelafarie.com/ngx-smart-modal/
MIT License
324 stars 87 forks source link

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

Open hakkikonu opened 1 year ago

hakkikonu commented 1 year ago
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 [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.

maximelafarie commented 1 year ago

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

artbat commented 11 months ago

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

image

gregorygregio commented 10 months ago

Got the same issue. Is there a workaround available?

pepas24 commented 10 months ago

@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 https://github.com/maximelafarie/ngx-smart-modal/issues/383#issuecomment-1897577989