Giter Club home page Giter Club logo

Comments (7)

scttcper avatar scttcper commented on June 15, 2024 1

I've cleaned up the example for 2.3.
https://github.com/scttcper/toastr-ng2/blob/master/src/app/pink.toast.ts

No more constructor or component hosts.

Annoying to copy the template and animations.

from ngx-toastr.

scttcper avatar scttcper commented on June 15, 2024 1

Released 4.3.0 with onAction that can be used in custom toasts. onAction is passed back the same way onTap is except it isn't used anywhere in the default template. The pink toast in the demo shows how it might be used. You will probably want to combine this with tapToDismiss = false or capture the click event and stop propagation.

<a (click)="action()">Action Name</a>
action() {
  this.onAction.next('helpful string');
  this.onAction.complete();
}

from ngx-toastr.

cmckni3 avatar cmckni3 commented on June 15, 2024

This is the neat thing about this project vs ng2-toastr.

My only complaint is component inheritance requires a bit of effort because of the component decorator.

from ngx-toastr.

cmckni3 avatar cmckni3 commented on June 15, 2024

This might be worth revisiting since the latest version uses DI to inject more dependencies than previously. Some of the dependencies are actually private (ToastData, ToastRef).

from ngx-toastr.

cmckni3 avatar cmckni3 commented on June 15, 2024

For my use case, I think composition would be better. I added a custom button and click handler to the template.

from ngx-toastr.

scttcper avatar scttcper commented on June 15, 2024

Think we need a button that isn't close. Its not in the original toastr, but i see it in every other library's toast. Like blueprint http://blueprintjs.com/docs/#components.toaster

screen shot 2017-02-20 at 7 41 57 pm

from ngx-toastr.

trevor-hackett avatar trevor-hackett commented on June 15, 2024

I like the idea of having the extra button. Could definitely find use cases for it.

from ngx-toastr.

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.