tellform/public/modules/forms/directives/field-icon.client.directive.js
2015-07-03 22:54:17 -07:00

32 lines
897 B
JavaScript

'use strict';
angular.module('forms').directive('fieldIconDirective', function($http, $compile) {
return {
templateUrl: './modules/forms/views/directiveViews/form/fieldIcon.html',
restrict: 'E',
scope: {
typeName: '@'
},
controller: function($scope){
var iconTypeMap = {
"textfield": "fa fa-pencil-square-o",
"dropdown": "fa fa-th-list",
"date": "fa fa-calendar",
"checkbox": "fa fa-check-square-o",
"radio": "fa fa-dot-circle-o",
"email": "fa fa-envelope-o",
"textarea": "fa fa-pencil-square",
"legal": "fa fa-legal",
"file": "fa fa-cloud-upload",
"rating": "fa fa-star-half-o",
"link": "fa fa-link",
"scale": "fa fa-sliders",
"stripe": "fa fa-credit-card",
"statement": "fa fa-quote-left",
}
$scope.typeIcon = iconTypeMap[$scope.typeName];
},
};
});