sweetalert2 / ngx-sweetalert2

Declarative, reactive, and template-driven SweetAlert2 integration for Angular
MIT License
657 stars 95 forks source link

error NG8001: 'swal' is not a known element: #213

Closed Sami-Kachai closed 1 year ago

Sami-Kachai commented 2 years ago

Hello,

I am trying to use the ngx-sweetalert2 component with Angular 10.0.11, I imported the SweetAlert2Module in the app.module.ts file (forRoot()) and I still get the following error :

error NG8001: 'swal' is not a known element:

  1. If 'swal' is an Angular component, then verify that it is part of this module.
  2. To allow any element add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component.

This is the swal component : <swal title="test" #deleteSwal> <div *swalPortal class="alert alert-info"> test

Would you kindly help me with this ?

Best Regards.

Kappyh commented 2 years ago

Hello,

I am trying to use the ngx-sweetalert2 component with Angular 10.0.11, I imported the SweetAlert2Module in the app.module.ts file (forRoot()) and I still get the following error :

error NG8001: 'swal' is not a known element: 1. If 'swal' is an Angular component, then verify that it is part of this module. 2. To allow any element add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component.

This is the swal component : <swal title="test" #deleteSwal> <div *swalPortal class="alert alert-info"> test

Would you kindly help me with this ?

Best Regards.

How is this component module imports? You have the import for the SweetAlert2Module in this component module?

What version of ngx-sweetalert2 you are using for the Angular 10?

diegodeg58 commented 2 years ago

Almost the same here, including the module import in the app module... In package.json:

"dependencies": {
    "sweetalert2": "^11.4.32",
    "@sweetalert2/ngx-sweetalert2": "^11.0.0",
}

In page.html <swal-icon type="warning" color="red"></swal-icon>

'swal-icon' is not a known element:
1. If 'swal-icon' is an Angular component, then verify that it is part of this module.
2. If 'swal-icon' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.ngtsc(-998001)
limonte commented 1 year ago

closing due to inactivity