'use strict'; // coffeescript's for in loop var __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; angular.module('forms').directive('fieldDirective', ['$http', '$compile', '$rootScope', function($http, $compile, $rootScope) { var getTemplateUrl = function(field) { var type = field.fieldType; var templateUrl = 'modules/forms/views/directiveViews/field/'; var supported_fields = [ 'textfield', 'email', 'textarea', 'checkbox', 'date', 'link', 'dropdown', 'hidden', 'password', 'radio', 'legal', 'statement', 'rating', 'yes_no', 'number', 'natural' ]; if (__indexOf.call(supported_fields, type) >= 0) { templateUrl = templateUrl+type+'.html'; } return templateUrl; }; return { template: '