Skip to content

Instantly share code, notes, and snippets.

@bigeasy
Created April 16, 2011 15:26
Show Gist options
  • Select an option

  • Save bigeasy/923192 to your computer and use it in GitHub Desktop.

Select an option

Save bigeasy/923192 to your computer and use it in GitHub Desktop.
Async Eco Template
<html>
<head>
<title>This is a title.</title>
</head>
<body>
<%!= @load "projects", (data) => %>
<h2>Projects</h2>
<% for project in data.projects: %>
<%!= @load "assignments", (data) => %>
<p>I should print out that assignment here.</p>
<% end %>
<% end %>
<p><a href="about.html">About Us</a></p>
<% end %>
</body>
</html>
method = require("./example")
class Example
load: (type, callback) ->
process.nextTick -> callback({ projects: [ 1, 2, 3] })
method new Example(), (output) -> console.log output
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment