Project

cft-source

0.0
No commit activity in last 3 years
No release in over 3 years
JavaScript source code for the CFT (CoffeeScript fragment template) compiler
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies
 Project Readme

CFT: CoffeeScript fragment templates

CFT lets you embed CoffeeScript in your markup. It's a lot like Eco, except it generates Document Fragments instead of strings.

Using document fragments for templates lets you do some interesting things, such as dynamic DOM updation. For example:

<% @observe @post => %>
  <!-- Run whenever post changes -->

  <span><%= @post.get('name') %></span>
<% end %>


<% @observeEach User.all() (user) => %>
  <!-- Run whenever we create/update/change a user -->
  <label>Name: <%= user.name %>
<% end %>