0

I am currently trying to create a table with the last 5 notifications that were created using angularjs-toaster (https://www.npmjs.com/package/angularjs-toaster). I understand this service fairly well, but I have not been able to find an answer if it is possible to get access to past toasts that were "shooted". With this the user could be able to see his/her last notifications. This is how I defined the toasts If it helps.

$rootScope.notify = function(type, message,title, timeout) {
    // function to pic timeout
    function pick(arg, def) {
        return (typeof arg === undefined ? def : arg);
    }

    timeout = pick(timeout, 5000);
    toaster.pop({
        type: type,
        body: message,
        title:title,
        timeout: timeout,
    });
};
5
  • You need to store the notification every time it is fired in a database and show the top 5 from it. Commented May 2, 2022 at 12:45
  • Do you have any idea how to do that? Commented May 5, 2022 at 11:59
  • What do you mean? You don’t know how to store in database or you don’t know when to? Commented May 5, 2022 at 13:47
  • just create some array and push the toaster config to this array Commented May 6, 2022 at 22:28
  • I have no idea how to store a notification. Im new with programming. Do I need to introduce some data base engine? Commented May 8, 2022 at 7:59

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.