Fire swal via template
See original GitHub issueHi all together,
I’d like to fire swal alerts via template without going the ViewChild-way.
Example:
<swal *ngIf="(error$ | async) as error" [title]="error.title" [text]="error.text" icon="error"> </swal>
The really big advantage I see here is, that my redux store does all the work and I don’t need to do the show and hide logic.
I’d be really grateful if anybody knows a solution to this. Even a workaround (without ‘codebehind’) would be fine.
Issue Analytics
- State:
- Created 4 years ago
- Comments:11 (6 by maintainers)
Top Results From Across the Web
SweetAlert2 - a beautiful, responsive, customizable and ...
A beautiful, responsive, customizable and accessible (WAI-ARIA) replacement for JavaScript's popup boxes.
Read more >how to have 2 swal templates open - Stack Overflow
is it possible to have two swal templates from sweeter alerts open at the same time? picture this: I am developing a blog...
Read more >Guides - SweetAlert
The only code that's specific to SweetAlert is the swal.setActionValue() and the swal() call at the end. The rest is just basic React...
Read more >Creating Pretty Popup Messages Using SweetAlert2 - Code
There are two ways to create a sweet alert using the Swal.fire() ... If you interacted with the alert messages in the first...
Read more >SweetAlert2 (Advance version of SweetAlert) - GeeksforGeeks
Example 1: In this example, we will simply display sweetAlert2. ... Swal.fire( 'Nice to meet you' , '' , 'success' );.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This option will also be available in forRoot(). And to set native SweetAlert options, you can actually already do that in forRoot() too, by providing a SweetAlert mixin, it’s just a bit verbose 😃 (*)
(*) previous version allowed to pass options direclty, but that became redundant with mixins. And I’ve been able to simplify the integration code in a very generic way with
provideSwal
. So this became the way to specify global options too.No problem at all! After all, it’s “just” open source and you are doing it in your free time (i guess?).