Comments (8)
I saw this module today and I love it, it has more option and functionality that I like. lemme go through it and give you my feedback where you could improve on.
from ng-snotify.
I'am not sure that you can do this at all.
But looks like a nice idea to work about.
I'll try to implement it this weekend
from ng-snotify.
@artemsky this is nice project, could you reduce the amount of code and how to print a message without the tittle or even pass your own massage like ng2-flashmessage.
from ng-snotify.
@gbrigens I'll try to do something with it)
Could you create new issue with your suggestion, and add more info (link) about ng2-flashmessage
from ng-snotify.
@maxxt Sorry for your waiting. Hand no time, to review.
I found that you can call that action.
When you calling any type of toast it returns self id
Then you can get current toast object with snotifyService.get(id)
that represent the following structure
{
"id":1055795966222,
"title":"Snotify title!",
"body":"Lorem ipsum dolor sit amet!",
"config":{
"showProgressBar":true,
"timeout":3000,
"closeOnClick":false,
"pauseOnHover":true,
"buttons":[
{
"action": function()
"text":"Yes",
"bold":false
},
{
"action": function()
"text":"No",
"bold":true
}
],
"placeholder":"Enter answer here...",
"bodyMaxLength":80,
"titleMaxLength":15,
"backdrop":-1,
"type":6
}
}
So you can call you action by accessing this object.
const id = snotifyService.confirm("title", "body", {
buttons: [
{text: 'Yes', action: () => doSomeJob(), bold: false},
{text: 'No', action: () => doAnotherJob(), bold: true},
]
});
snotifyService.get(id).config.buttons[0].action()
For testing, its fine.
But its not recommended to call it pragmatically in production for now. I have an issue, where toast is not hiding, if you calling snotifyService.remove(id)
inside action;
Need to fix it.
from ng-snotify.
@artemsky thanks for the reply.
Inside the action I am not passing an ID as a param to remove() and it works just fine.
from ng-snotify.
@maxxt Without id
it removes all notifications)
from ng-snotify.
@artemsky Nope, in my case it doesn't.
from ng-snotify.
Related Issues (20)
- Support for Angular 11
- Support for Angular 11
- Upgrade to support angular v10+ HOT 1
- Any chance to update for Angular 12+ please?
- Get confirm/ prompt data through variable ?
- Dynamic title/body ?
- How to delete a record on confirm box "yes"
- cannot install: latest angular
- Moved to ngx-snotifire HOT 1
- How to remove SnotifyToast by button/icon in html template
- Can someone take over maintaining this package please?
- Remove SnotifyToast when clicking outside or pressing escape
- After Updating Ng Snootify in Angular 9 Bugs HOT 21
- Issue with Angular 9 Ivy after upgrading to ng-snotify 9.0.0 HOT 2
- Cannot Import Css in Stackblitz in Angular 9 HOT 2
- Cannot read property "toast" of undefined HOT 2
- I use styles.less, cannot use *.scss [ver 9.0.1]
- confirm backdrop is hidden when another notification is closed.
- Can I hide the toaster when rout change? HOT 1
- Undefined config HOT 2
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 ng-snotify.