Giter Club home page Giter Club logo

Comments (2)

toverux avatar toverux commented on June 14, 2024

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 named delete. 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.

toverux avatar toverux commented on June 14, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.