angular.module('app').directive('componentSelect', [ function() { return { restrict: 'A', scope:{ opts: '=', // Component Options object }, link: function(scope, element) { var list = [], o, id; var opts = scope.opts; //TODO: take current ship mass into account if provided // Generting the HTML in this manner is MUCH faster than using an angular template. for (id in opts) { o = opts[id]; list.push('