FACK1 / week8---SAAO

Week 8 - Express app.
1 stars 1 forks source link

node-alert #41

Open m4v15 opened 5 years ago

m4v15 commented 5 years ago

I'm not sure about using node-alert, it makes the pop up appear in your tests and also it's really unclear how it works or behaves. It would be better (and more fun!) to try and solve this problem yourself.

What you could do is add something on to the res.locals before you do the redirect (say res.locals.added, then in the / handler, you can check the locals and if it has this added key it could send some context in the res.render, maaaaaybe say `res.render("home", {added: true}). Then in the hbs file you can check for this context and if it exists, call a script which will do your own window.alert 💃