简体   繁体   English

如何在车把模板中输出?

[英]How can I output this in a handlebars template?

I'm using express and handlebars, and I have the following express code in the controller for a handlebars template. 我正在使用express和handlebars,并且在控制器中我为handlebars模板使用了以下express代码。

  getUserID = function (request, response ) { var userIDtest = registerRepository.getUserID('PretendthisisauserID'); return userIDtest; }, 

How can I output what is contained within "userIDtest" to a 如何将“ userIDtest”中包含的内容输出到

tag or something in a handlebars template. 标签或把手模板中的内容。

response.locals.userIDtest = userIDtest;

并像这样访问它:

{{userIDtest}}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM