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

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

Open prudnikov opened this issue 1 year ago • 4 comments

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?

prudnikov avatar Dec 10 '23 11:12 prudnikov

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

beachespecially avatar Dec 11 '23 12:12 beachespecially

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

prudnikov avatar Dec 11 '23 13:12 prudnikov

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.

pepas24 avatar Jan 18 '24 00:01 pepas24

@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.

Bierat1337 avatar Jan 31 '24 14:01 Bierat1337