Git Product home page Git Product logo

Comments (8)

gbrigens avatar gbrigens commented on May 26, 2024 1

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.

artemsky avatar artemsky commented on May 26, 2024

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.

gbrigens avatar gbrigens commented on May 26, 2024

@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.

artemsky avatar artemsky commented on May 26, 2024

@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.

artemsky avatar artemsky commented on May 26, 2024

@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.

maxxt avatar maxxt commented on May 26, 2024

@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.

artemsky avatar artemsky commented on May 26, 2024

@maxxt Without id it removes all notifications)

from ng-snotify.

maxxt avatar maxxt commented on May 26, 2024

@artemsky Nope, in my case it doesn't.

from ng-snotify.

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.