防爆pressjs res.render不angularjs谐音渲染值 [英] Expressjs res.render not rendering values in angularjs partials
问题描述
我重定向到下一个页面登录后前pressjs登录后,我必须从angularjs路由器这是所有罚款和工作装一些谐音。在res.render我有一些数据集是这样的。
I am redirecting to next page after login on expressjs after login, I have some partials to be loaded from angularjs routers which is all fine and working. In res.render I have some data set like this.
res.render('employelogin / employlogin',{标题:表|员工'用户名:req.session.nameName,日期时间:resultDate,时间表:时间表});
res.render('employelogin/employlogin', { title: 'Sheet | Employee',userName: req.session.nameName,DateTime:resultDate,timesheet:timeSheet});
在Angularjs,我已经为告诉它加载罚款玉模板,还有我试图让DateTime和正在打印这个时间表是code
On the Angularjs, I have a jade template which loads fine as told, there I am trying to get the DateTime and Timesheet being printed this is the code
****在#{}的DateTime 并为#{}时间表
****was at #{DateTime} and was #{timesheet}
我没有得到这里正在打印的日期时间和时间表文本。
I am not getting the datetime and timesheet text being printed here.
**的个行业的数据都来了。我已经看到它在控制台上即将**
** The data for the fileds are coming. I have seen it coming on console **
推荐答案
我有这样的事情在我玉模板(我发送一个API对象和令牌)
I have something like this in my jade template (I'm sending an api object and a token)
script(type="text/javascript").
var api = !{JSON.stringify(api)} , token= '!{token}';
我同时声明为全局变量,我再利用的AngularJS。希望这有助于。
I declare both as global variables that I re-use in AngularJS. Hope this helps.
这篇关于防爆pressjs res.render不angularjs谐音渲染值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!