Pass a function to deltemplate

35 views
Skip to first unread message

Marcelo Formentão

unread,
Apr 2, 2018, 10:17:37 AM4/2/18
to Closure Templates Discuss
Hi,

I have a deltemplate that call a component with variant and I need to pass a function on a `data-onclick` but I cant change it since it's an internal package.

The call

{deltemplate ElectricNavigation.anchor variant="'sidebar'"}
  {@param page: ?}

{if not $page.children}
   <a class="sidebar-link {$page.active ? 'sidebar-link-selected' : ''}" href="{$page.url}">
{else}
<a class="sidebar-link {$page.active ? 'sidebar-link-selected' : ''}" data-onclick="handleCollapseClick_" href="javascript:;">
{/if}
{/deltemplate}

The error:

No function named handleCollapseClick_ was found in the component
                        "ElectricNavigation". Make sure that you specify
                        valid function names when adding inline listeners

Thanks!

Luke Sandberg

unread,
Apr 3, 2018, 1:09:00 PM4/3/18
to closure-temp...@googlegroups.com
Sorry, what is the question?  how to override the 'onclick' value?  if so, there is no way to do this.  you should modify the template to make this configurable

--

---
You received this message because you are subscribed to the Google Groups "Closure Templates Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to closure-templates-...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages