Created
August 6, 2014 19:56
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% | |
catchExports.foo = function(buf, text) { | |
%><h1><%= text %></h1><% | |
} | |
catchExports.bar = function(buf, text) { | |
%><p><%= text %></p><% | |
} | |
%> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% 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