How to call function together with interpolation from x-handlebars-template

0

I'm trying to call a function to change the type of my imput.

 <input type="getTypeHtml({{tipoDeDado}})"

function

  function getTypeHtml(tipoDeDado) {

        var typeHtml = 'text';

        switch (tipoDeDado) {
            case 0: typeHtml = 'text'; break;
            case 1: typeHtml = 'number'; break;
            case 2: typeHtml = 'datetime-local'; break;
            case 3: typeHtml = 'number'; break;
            case 4: typeHtml = 'radio'; break;
            default: typeHtml = 'text'; break;
        }

        return typeHtml;
    };

But I can not call using x-handlebars-template interpolation.

    
asked by anonymous 24.05.2018 / 18:22

0 answers