good Morning!
excuse my lack of knowledge , I am new to the angular-formly and I wonder how and where should I create a validation for did not accept the input numbers.
my code is below. Captures the value on the screen, remove the number over not appear on the new format screen
help
sorry the English using google translator
.run(function(formlyConfig) {
formlyConfig.setType({
name: 'fabio',
extends: 'input',
template: '<input class="form-control" id="fabio" ng-model="model[options.key]" ng-change="soChar()" ng-controller="AlterardadospesCtrl">',
wrapper: ['bootstrapLabel', 'bootstrapHasError'],
defaultOptions: {
validators: {
soChar : function ($viewValue, $modelValue) {
var teste1 = $viewValue.replace(/[0-9]+/g,'')
}
}
},
})
})
Json
{
"className": "col-md-5 ",
"type": "fabio",
"key": "Nome",
"templateOptions": {
"type": "text",
"label": "Nome"
}
},