问题
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', { title: 'Sheet | Employee',userName: req.session.nameName,DateTime:resultDate,timesheet:timeSheet});
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
****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 **
回答1:
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}';
I declare both as global variables that I re-use in AngularJS. Hope this helps.
来源:https://stackoverflow.com/questions/22201441/expressjs-res-render-not-rendering-values-in-angularjs-partials