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

Support for Angular 18 standalone component. NullInjectorError: No provider for _SweetAlert2LoaderService! #266

Open
suhailkc opened this issue Sep 16, 2024 · 0 comments

Comments

@suhailkc
Copy link

I am using ngx-sweetalert2 in an Angular lazy-loaded standalone component, but I'm encountering the following error in the console: NullInjectorError: No provider for _SweetAlert2LoaderService!

..
import { SweetAlert2Module } from '@sweetalert2/ngx-sweetalert2';

@Component({
..
standalone: true,
imports: [SweetAlert2Module],
..
})
..

How to fix this without adding the SweetAlert2Module.forRoot() to importProvidersFrom([]) in app.config.ts?

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

1 participant