简体   繁体   English

在闭包模板中使用delcall deltemplate时出现奇怪的错误

[英]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.

相关问题 删除目录时的奇怪错误 - The strange error when deleting the directory 当apache开始新的会话时,抛出一个奇怪的错误 - When apache starts new session a strange error is throwing 在 Heroku 上部署 django 应用程序时出现非常奇怪的错误 - Getting really strange error when deploying a django app on Heroku 查询DOES返回数据时出现奇怪的微风错误(更新:元数据未正确加载) - Strange Breeze error when query DOES return data (update: Metadata not loading correctly) 独立存储-带有异常的奇怪错误 - Isolated Storage - strange error with Exception 在Symfony 3应用中使用捆绑包错误模板 - Use bundle error templates in Symfony 3 app 以下代码中的闭包修改是否有可能出错? - Is there any possibility that there is an error by modified closure in the following code? 在.net应用程序中使用异步时出现奇怪的异常 - Strange exception when using Async in .net application 当Debug = False时完全禁用Http 404/500模板 - Completely disable Http 404/500 templates when Debug=False 结构化日志记录异常消息文本时需要两个消息模板 - Two message templates required when structured logging exception message text
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM