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;
33 type = type.charAt(0).toUpperCase() + type.slice(1);
35 return 'angular-elastic-builder/types/' + type + '.html';
38 // This is a weird hack to make sure these are numbers
39 scope.booleans = ['False', 'True'];
40 scope.booleansOrder = ['True', 'False'];
42 scope.inputNeeded = function() {
53 return ~needs.indexOf(scope.rule.subType);