javascript - Dynamicaly changing ng-pattern regex -


i want changing regex pattern same rules. example in plunker

if selected type, have regular expression, model updated, if value valid. if selected type, doesn't have regular expression (e.g. 'string' in code), model never updated. doesn't matter, if function returned null or empty string.

my question is, if exist way, how turn validation off?

you can return .* when want allow input:

$scope.getvalidatorregex = function () {       switch ($scope.type) {           case 'int':             return /^\d+$/;           default:             return /.*/;       } }; 

Comments

Popular posts from this blog

plot - Remove Objects from Legend When You Have Also Used Fit, Matlab -

java - Why does my date parsing return a weird date? -

Need help in packaging app using TideSDK on Windows -