0.0.4 • Published 11 years ago

tower-directive-expression v0.0.4

Weekly downloads
10
License
-
Repository
-
Last release
11 years ago

Directive Expression Compiler

Installation

node.js:

npm install tower-directive-expression

browser:

component install tower/directive-expression

Example

var compile = require('tower-directive-expression');
var exp = compile('data-text', 'post[attr.name]');
console.log(exp.edges); // attribute chains to watch

Watching content for changes.

var content = require('tower-content');
var scope = content('page').init({ title: 'foo' });
var el = document.querySelector('#title');

exp.watch(scope, function(){
  el.textContent = exp.fn(scope);
});

Licence

MIT