Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在我的玉模板中使用内联 javascript 来生成谷歌地图。我的问题是:如何将变量/对象从 node/express 控制器传递到这个内联 javascript 片段中?
有任何想法吗?谢谢
应用程序.js:
app.get('/', function(req, res){ res.render('index.jade', { title: 'My Site', variable: { javascript: 'object' } }); });
index.jade:
- var header = 'this is from an ' + variable.javascript; h1= header