angularjs - force form to be invalid programmatically -


this question related previous question :

access form during component initialization in angularjs

so tried used $watch following :

$scope.$watch('mylinkform_org', function(form) {                 if(form) {                      form.$valid = false;                     form.$invalid = true;                     form.organisme.$valid = false;                     form.organisme.$invalid = true;                     form.organisme.$setdirty();                 }                 else {                     console.log('form undefined');                 }                     }); 

but i'm looking solution other using watchers, anyway, inside watch i'm trying initilize form validity it's false, didn't work expected, outer form's validity true, when change state of component , inner form becomes invalid outer form invalid too, why outer form not becoming invalid when initilized inner form invalid ?


Comments

Popular posts from this blog

What is happening when Matlab is starting a "parallel pool"? -

php - Cannot override Laravel Spark authentication with own implementation -

Qt QGraphicsScene is not accessable from QGraphicsView (on Qt 5.6.1) -