Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/templates/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Templates 下划线模板未使用<;%呈现变量-_Templates_Escaping_Underscore.js_Underscore.js Templating - Fatal编程技术网

Templates 下划线模板未使用<;%呈现变量-

Templates 下划线模板未使用<;%呈现变量-,templates,escaping,underscore.js,underscore.js-templating,Templates,Escaping,Underscore.js,Underscore.js Templating,我有一个简单的模板: <div class='welcome'>Welcome <%- first_name %>!</div> 这将正确记录变量: <div class='welcome'>Welcome <%- first_name %><% console.log(first_name);console.log(typeof(first_name)); %>!</div> 欢迎! 其类型为预期的str

我有一个简单的模板:

<div class='welcome'>Welcome <%- first_name %>!</div>
这将正确记录变量:

<div class='welcome'>Welcome <%- first_name %><% console.log(first_name);console.log(typeof(first_name)); %>!</div>
欢迎!
其类型为预期的
string
。我在社区里找不到有同样问题的人。我有什么明显的遗漏吗


在上下文中,这是在负责显示模板的木偶应用程序中使用的。

这是一个与
requirejs tpl
相关的问题。下面是对

道森托斯在他的房间里做了个安排


要将其添加到您的bower依赖项,请添加
“requirejs tpl dawsontoth”:“*”,
(它还取决于
requirejs文本

我用来加载模板的requirejs tpl。我无法在JSFIDLE中复制它。。。这是我的
.templateSettings
{evaluate://g,interpolate://g,escape://g}
它似乎与
下划线
源代码中的相同。这确实是一个与
requirejs tpl
相关的问题。谢谢你给我指明了正确的方向!
<div class='welcome'>Welcome <%- first_name %><% console.log(first_name);console.log(typeof(first_name)); %>!</div>