angularjs - express angular ejs passing variable to template -
After login authentication, I am trying to pass message variables for my EJS template:
App post ('/ login', passport. Authentication ('local-login', {successRedirect: '/ profile', failureRedirect: '/ login', failureFlash: true}));
Then get the block code:
if (req.isAuthenticated ()) res.render ('partial /' + name, {message: 'testing' });
Therefore, the user will be notified if the login fails. Login.ejs will show a partial message, but the message will not appear in the template:
& Lt ;! - Any messages that come back with certification - & gt; & Lt; Div ng-if = "message.length & gt; 0" class = "alert alert-danger" & gt; {{Message}} & lt; / Div & gt;
However, when I can see the log message in the admin:
app.controller ('LoginCtrl', ['$ scope', '$ Http ', function ($ radius, $ http) {console.log (' message: '+ message); // output message: test}]);
If you want your JSON unsecured to be of But if it is not templating at all, then you have other problems. You - ;
& lt; Script & gt; Var message = "& lt;% - message%>"; & Lt; / Script & gt;
JSON.stringify (obj)
.
Comments
Post a Comment