2 * angular-elastic-builder
4 * /src/directives/RuleTypes.js
6 * Determines which Rule type should be displayed
12 var app = angular.module('angular-elastic-builder');
14 app.directive('elasticType', [
24 template: '<ng-include src="getTemplateUrl()" />',
26 link: function(scope) {
27 scope.getTemplateUrl = function() {
28 var type = scope.type;
31 type = type.charAt(0).toUpperCase() + type.slice(1);
33 return 'angular-elastic-builder/types/' + type + '.html';
36 // This is a weird hack to make sure these are numbers
37 scope.booleans = [ 'False', 'True' ];
38 scope.booleansOrder = [ 'True', 'False' ];
40 scope.inputNeeded = function() {
51 return ~needs.indexOf(scope.rule.subType);