Closed steve3d closed 1 year ago
Sorry, I just found out that [swal]
directive can not be standalone, because it might need SwalComponent
.
I have an complete rewritten version of this package, and the component/directive are all standalone, I also changed a lot of implementation, and matching the latest angular changes, removed the SweetAlert2LoaderService
SwalPortalComponent
and SwalPortalTargets
, it's much easier to understand the code now.
If you have time, you might want to checkout my version: https://github.com/steve3d/ngx-sweetalert2-standalone
because this version only works with angular 16(esm format change), So I'm not sure if I can create such big change PR.
Hey @steve3d and sorry for the huge delay in my response!
I just merged #245 because it looks simple and will work for our users without breaking changes.
I guess you're also good and using @vrdd/ngx-sweetalert2
.
Thank you for the contribution and sorry that it wasn't merged!
Angular 16 has been released. And in angular 15.2, the standalone was production ready.
So I created a new
provideSweetalert2
function to use with these standalone applications. Because of the nature of sweetalert2, I don't think changeSwalComponent
,SwalPortalDirective
, to standalone is a good idea, because these two are bounded together, butSwalDirective
can be standalone.Angular 16 also changed module target to
ES2022
, So I also updated thetsconfig.json
andangular.json
to meet the latest version of angular. So this version should only support angular 16+.Hoping this will be released soon.