maximelafarie / ngx-smart-modal

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

Can't bind to 'autostart' since it isn't a known property of 'ngx-smart-modal' #383

Open prudnikov opened 11 months ago

prudnikov commented 11 months ago

I'm upgrading angular 14 to 15 and ngx-smart-modal from 7.4.1 to 14.0.3 and it start throwing this error.

Error: src/app/supply/my-edit-modal/my-edit-modal.component.html:2:3 - error NG8002: Can't bind to 'autostart' since it isn't a known property of 'ngx-smart-modal'.
1. If 'ngx-smart-modal' is an Angular component and it has 'autostart' input, then verify that it is part of this module.
2. If 'ngx-smart-modal' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.
3. To allow any property add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component.

2   [autostart]="true"
    ~~~~~~~~~~~~~~~~~~

  src/app/supply/my-edit-modal/my-edit-modal.component.ts:23:16
    23   templateUrl: './my-edit-modal.component.html',
                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Error occurs in the template of component PwfOnPalletEditModalComponent.

But when I look at the source code it indeed exists https://github.com/maximelafarie/ngx-smart-modal/blob/90616b5876de6e7db0913fb65fb66f5e01ba1a58/projects/ngx-smart-modal/src/lib/components/ngx-smart-modal.component.ts#L76C23-L76C23. Any ideas how to fit it?

beachespecially commented 11 months ago

I have the same issue, but with different inputs: closable and hideDelay. Angular version: 15 ngx-smart-modal version: 14.0.3

NgxSmartModalModule.forRoot() is imported in the app.module.ts

prudnikov commented 11 months ago

Yes @beachespecially, I have to say that closable, hideDelay and identifier also have the same problem.

pepas24 commented 10 months ago

I think this errors is due to version 14.0.3 of ngx-smart-modal was compiled with Angular 16. I had to copy the code from the library to my application to be able to use it in Angular 14. Just downgrading to use Angular 14 and build it will fix the issue. Maybe the last changes should be published as separete versions 14, 15, 16 to ensure the correct function of library specially because the 14.x version should work with Angular 14 and it doesn't.

@maximelafarie if you are agree a can make separete PR to use angular 14 for the build, and test against 15 and 16 versions, and if necesary make additional PRs for every version.

Bierat1337 commented 10 months ago

@prudnikov as @pepas24 mentioned 14.0.3 is compatible with Angular 16. In your case I recommend upgrade to Angular 16 since you are already upgraded from 14 to 15. So try to get it to 16 without errors and after that probably go for 17 aswell. In 17 are some awesome changes like signals and the new control flow you should use in the near future.