A Flight mixin that enriches components with underscore.js _.each function.
bower install --save flight-withEachdefine(function(require) {
var defineComponent = require('flight/lib/component');
var withDialog = require('bower_components/flight-withEach/lib/withEach');
return defineComponent(fancyComponent, withEach);
function fancyComponent() {
// Logs each number in turn
this.each([1, 2, 3], function(value, i) {
console.log(value);
});
// Logs each number in turn
this.each({one: 1, two: 2, three: 3}, function(value, i){
console.log(value);
});
}
});Development of this component requires Bower, and preferably Karma to be globally installed:
npm install -g bower karmaThen install the Node.js and client-side dependencies by running the following commands in the repo's root directory.
npm install
bower installTo continuously run the tests in Chrome and Firefox during development, just run:
karma startAnyone and everyone is welcome to contribute. Please take a moment to review the guidelines for contributing.
