[英]Strange error when delcall deltemplate in closure templates
I use some delegate templates in the project and I use same approach but in some case i have exception. 我在项目中使用了一些委托模板,并且使用了相同的方法,但是在某些情况下,我有例外。 This is the exception I got:
这是我得到的例外:
Exception is
com.google.template.soy.tofu.SoyTofuException: Found no active impl for delegate call to 'components.TemplateName'
Could somebody explain what is the best way to use delegate templates in soy files. 有人可以解释在大豆文件中使用委托模板的最佳方法是什么。
I found where was my mistake. 我发现我的错误在哪里。 I was missed ".delegate" in the end of delcall call.
在delcall通话结束时,我错过了“ .delegate”。 Here is some simple scenario:
这是一些简单的情况:
{namespace somescope}
{template .Template}
{@param data: ?}
{@param variant: string}
{delcall somescope.TransportLeg.delegate data="all" variant="$variant"/}
{/template}
{deltemplate somescope.TransportLeg.delegate variant="'admin'"}
{@param data: ?}
<h1>Hello {$data.hello}<a href="{$data.edit}">edit</a></h1>
{/deltemplate}
{deltemplate somescope.TransportLeg.delegate variant="'user'"}
{@param data: ?}
<h1>Hello {$data.hello}</h1>
{/deltemplate}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.