class AngularJSTextInput(TextInput):

    def __call__(self, field, **kwargs):
        for key in list(kwargs):
            if key.startswith('ng_'):
                kwargs['ng-' + key[3:]] = kwargs.pop(key)
return super(AngularJSTextInput, self).__call__(field, **kwargs)
Custom attributes for Flask WTForms