node.js - How to get a value from Jade to Javascript? -
i know looks repetitive, little bit different other question here.
i using node expressjs routing , passportjs login , in login page have dropdown list select value want pass along angular script.
in app.js have:
var languages = [ {"lang": "english", "code": "en"}, {"lang": "chinese", "code": "zh-cn"} ]; app.get('/', detectbrowser, routes.index); app.get('/login', routes.login(issamesubnet, languages));
index.js:
exports.index = function(req, res){ res.render('index', { login: 'some string' }); }; exports.login = function(language) { return function(req, res) { res.render('login', { lang: language }); }; };
login.jade:
label.control-label language select.form-control each val, index in lang option(value= val.code)= val.lang
so how can grab value of option tag javascript , pass next stage (angularjs)?
i know how information exports.index on angular side, don't know how information want , use on index function.
thanks
Comments
Post a Comment