Coder Social home page Coder Social logo

Comments (2)

selangley-wa avatar selangley-wa commented on June 9, 2024 1

It will not work in Angular 16 until such time that the library is migrated to build with Ivy. With Angular 16, they decided to finally remove all compatibility with the older type of modules using the View engine.

https://angular.io/guide/update-to-version-16#angular-compatibility-compiler-ngcc-has-been-removed

Angular Compatibility Compiler (ngcc) has been removed

The Angular Compatibility Compiler (ngcc) was a build tool that facilitated compatibility between Angular's previous compiler and rendering architecture (View Engine) and its new architecture (Ivy).

View Engine was removed in Angular v13, and v16 finally removes ngcc. As a result, Angular libraries built with View Engine cannot be used in Angular v16+.

If this package does not get updated to support Ivy, you will need to remove this library for any project using Angular 16 or later.

Possible alternative libraries are:

https://www.npmjs.com/package/ngx-toastr
https://www.npmjs.com/package/@sweetalert2/ngx-sweetalert2
https://material.angular.io/components/snack-bar/overview
The next one is not distributed as a library but as tutorial/example of how to do it yourself, but focused on just "alerts"
https://jasonwatmore.com/angular-15-free-course-5-alerts-home-page

Update:
There are now two forks of this project that have both released npm packages that supposedly work with Angular 16 and Ivy:

https://github.com/ShacharHarshuv/Angular2-Toaster
https://www.npmjs.com/package/angular2-toaster-2

https://github.com/dmkachko/Angular2-Toaster
https://www.npmjs.com/package/@dkachko/angular2-toaster

@Stabzs

from angular2-toaster.

selangley-wa avatar selangley-wa commented on June 9, 2024

After spending some time looking at each of the alternative libraries I listed above, I think:
https://www.npmjs.com/package/ngx-toastr
provides the closest to a "drop-in replacement" for Angular2-Toaster

It has a somewhat different API, but most of the same functionality and configuration options as Angular2-Toaster. Additionally, it appears to be well-maintained with regular releases tracking the pace of Angular development and with a number of developers contributing to the project.

Depending on which version you use, you may want to take a look at the answers to this stack overflow question for guidance:
https://stackoverflow.com/questions/72473119/place-toastr-toasts-in-container-in-specific-component

SweetAllert2 and Angular Materials Snackbar component both provide toaster-like functionality, but that is not their main focus.
Also, they both explicitly state that they do not support displaying more than one toast on the screen at once.

sweetalert2/sweetalert2#2383
Display multiple toasts? #2383

angular/material#2799
$mdToast is supported multiple 'toast' at same time? #2799

from angular2-toaster.

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.