export function cilInputDirective() {
    const directive = {
        restrict: 'A',
        scope: false,
        // template: '<i class="input-helper"></i>',
        link: linkFunc
    };

    return directive;

    function linkFunc(scope, element) {
        const inputType = element.attr('type');
        if (inputType === 'checkbox') {
            element.parent().addClass('cil-checkbox');
            element.after('<span class="input-helper"></span>');
        } else if (inputType === 'radio') {
            element.parent().addClass('cil-radio');
            element.after('<span class="input-helper"></span>');
        } else if (inputType === 'text') {
            element.parent().addClass('cil-radio');
        } else {
            return;
        }
        // element.prev().addClass('cil-input');
    }
}