【发布时间】:2014-11-07 00:57:42
【问题描述】:
我正在修改一些预设传统非 SPA 页面加载的代码,并向用户显示由连接闪存中间件生成的闪存消息。它通过传入一个在 EJS 文件中呈现的对象来做到这一点。
我的应用程序是有角度的,我在后端没有模板引擎,并且希望避免使用一个。我怎样才能让角度意识到这些闪存消息?
这里是上下文:passportjs 出错时重定向到 /signup
// process the signup form
app.post('/signup', passport.authenticate('local-signup', {
successRedirect : '/profile', // redirect to the secure profile section
failureRedirect : '/signup', // redirect back to the signup page if there is an error
failureFlash : true // allow flash messages
}));
感谢您的帮助!
【问题讨论】:
-
两个想法,cookie 或 url 参数,如
'invalid',如果消息是微不足道的并且可以在 angular 中设置为简单的配置数组
标签: javascript angularjs node.js passport.js