sweetalert2 / ngx-sweetalert2

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

provide simple example for `SwalPortalDirective` #234

Closed gocs closed 1 year ago

gocs commented 1 year ago

feel free to update the code snippet to your liking

I was confused at first when I read the readme.

toverux commented 1 year ago

Hi, it seems redudant with current examples. What do you feel was missing in the examples as they are now?

gocs commented 1 year ago

Hi, The current examples shows mostly the html codes in strings and I thought I couldn't use actual HTML. That's before I realized there's ng-container with the directive.

I thought I could only do this:

<button [swal]="swal_portal" (confirm)="submit()">
  Swal button
</button>

<swal #swal_portal title="Swal Title" html="Please press <b>OK</b>?" icon="warning"></swal>

Then I thought a simple copy-pasteable snippet could be good for people want something simple like an alert but can also add HTML tags.

limonte commented 1 year ago

Since @toverux isn't convinced that this PR is worth merging, I'll close it. Thank you @gocs for the contribution and sorry your PR wasn't merged!