Comments (7)
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.
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.
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.
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.
For my use case, I think composition would be better. I added a custom button and click handler to the template.
from ngx-toastr.
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
from ngx-toastr.
I like the idea of having the extra button. Could definitely find use cases for it.
from ngx-toastr.
Related Issues (20)
- i change toaster version that was my problem HOT 2
- Dynamically show/hide all of the displayed toasts
- Toastr not working in Angular 15.2.0
- How to add a popup animation?
- enableHtml removes svg in html string
- ToastrService/ToastrModule import cost is too much HOT 1
- .clear() on duplicate toast
- ngx-toastr not displaying until I refresh the page HOT 4
- Incorrect Position CSS HOT 2
- ngx-toaster not imported in angular 17 HOT 3
- Unable to modify Toast CSS HOT 1
- toast timeOut not working for latest version HOT 1
- Error: Can't resolve '~ngx-toastr/toastr.css' in HOT 4
- maxOpened doesn't work HOT 1
- Error: node_modules/ngx-toastr/toastr/toast-injector.d.ts:47:5 - error TS2416: Property 'get' in type 'ToastInjector' is not assignable to the same property in base type 'Injector'. HOT 1
- How to include Emojis in toastr message HOT 2
- v. 17.0.1: TypeError: Cannot read properties of undefined (reading 'config') HOT 3
- cannot read properties of undefined (reading "toastrService") HOT 3
- Upgrade my project and my external third library from Angular 11 to 12 fails because of a dependency to "ngx-toastr" in my library HOT 2
- ToastContainerModule not found in 16.x.x HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ngx-toastr.