ngx-smart-modal icon indicating copy to clipboard operation
ngx-smart-modal copied to clipboard

Property 'closable' is incompatible with index signature.

Open hakkikonu opened this issue 1 year ago • 4 comments

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 avatar Nov 13 '23 14:11 hakkikonu

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

maximelafarie avatar Nov 16 '23 13:11 maximelafarie

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

image

artbat avatar Dec 13 '23 15:12 artbat

Got the same issue. Is there a workaround available?

gregorygregio avatar Jan 08 '24 17:01 gregorygregio

@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

pepas24 avatar Jan 18 '24 01:01 pepas24