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

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -