Comments (2)
Hello @kudsyf, interesting issue. I'd be happy to reproduce, but:
- You don't show where the closing
</li>
is, so I don't know if the<swal>
is comprised in the *ngFor here. Can you fix your code sample? - A potential problem I see: You have a
delete()
function in your TypeScript, but your swal is also nameddelete
. There's possibly a conflict here. Try to name your<swal>
"deleteSwal
" or something like that first.
edit: woops, edited your message to fix the mardown but I may have accidentally added the </li>
after having copy-pasted the code in my IDE to fix the indentation. Or was it here before and I missed it? I don't know as I can't see your original post anymore, sorry :/
from ngx-sweetalert2.
Hello again,
After reading this issue again, I immediately understood what's the problem. The thing is that each [swal]
will subscribe to confirm/cancel events of the same <swal>
instance. So the behaviour you've encountered make perfect sense. Each entry will subscribe to the same modal and all of them will receive the same confirm/cancel events.
This is logical but definitely not practical. I've released a new version where multiple [swal]
directives are now maintaining a "mutex" subscription to the shared <swal>
instance. This will give the expected behaviour.
Please upgrade you ngx-sweetalert2 version:
3.3.1 (2018-02-14)
Bug Fixes
- SwalDirective: SwalDirectives now do a "cooperative mutex" when subscribing to an existing SwalComponent instance (#40) (19bc9c3)
from ngx-sweetalert2.
Related Issues (20)
- Stricts templates & Angular Language Service HOT 1
- open multiple alerts HOT 1
- Default value for *swalPortal directive input HOT 7
- error NG8001: 'swal' is not a known element: HOT 3
- Modal when appear delete overflow-y : auto to hidden severals times HOT 1
- CommonJS or AMD dependencies can cause optimization bailouts. HOT 3
- Module not found: Error: Package path ./public-api is not exported from package HOT 1
- Generic type 'ɵɵ*Declaration' requires between x and y type arguments. HOT 8
- Add support for color property on SwalComponent
- add support for angular 15
- Cannot find module @sweetalert2/ngx-sweetalert2 or its corresponding type declarations HOT 1
- for Angular 16 HOT 4
- Compilation errors after last update - Angular 15 HOT 6
- Sweet alert over dialog primeng
- Will the library be upgraded to v17 of Angular? HOT 1
- Support for Angular 17 HOT 7
- Angular 17 - Stanalone components HOT 1
- Content shrinking when popup opens HOT 2
- Error during installation in Angular 17 HOT 5
- Support for Angular 18 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ngx-sweetalert2.