npm install tower-directive-expressionnode.js:
``bash`
npm install tower-directive-expression
browser:
`bash`
component install tower/directive-expression
`js`
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.
`js
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);
});
``
MIT