npm install tower-directiveAPI to the DOM. Tells the DOM what to do.
``bash`
$ component install tower/directive
`js
var directive = require('tower-directive');
directive('data-text', function(scope, element, attr){
element.textContent = scope[attr.value];
});
var content = { foo: 'Hello World' };
var element = document.querySelector('#example');
directive('data-text').exec(content, element);
`
`html`
becomes:
`html`
Hello World
The directives are used more robustly in tower-template.
This one must be exact to maximize performance.
Globally execute all directives.
Install testem:
`bash`
$ npm install -g testem
Install Node Packages:
`bash`
$ npm link
Install Components:
`bash`
$ component install -d
Run tests:
`bash``
$ testem
Then, open all the browsers you want to test by going to the outputted url defaulted to http://localhost:7357
Tests will run on any open browser linked to the stated url and your current Node environment.
Before you send a pull request, make sure your code meets the style guidelines at https://github.com/tower/style-guide and all tests pass.
- http://en.wikipedia.org/wiki/Content_(media)
- http://en.wikipedia.org/wiki/Scope_(computer_science)
- http://en.wikipedia.org/wiki/Directive_(programming)
MIT