Skip to content

Instantly share code, notes, and snippets.

@rpominov
Created August 6, 2014 19:56
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rpominov/79f423735e6642d81c1f to your computer and use it in GitHub Desktop.
Save rpominov/79f423735e6642d81c1f to your computer and use it in GitHub Desktop.
An example of how to export functions from template to template in ejs
<%
catchExports.foo = function(buf, text) {
%><h1><%= text %></h1><%
}
catchExports.bar = function(buf, text) {
%><p><%= text %></p><%
}
%>
<% var catchExports = {} %>
<% include foo %>
<% catchExports.foo(buf, 'abc') %>
<% catchExports.bar(buf, '123') %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment