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

Is there a better way to structure post methods in Class Based Views -

reflection - How to access the object-members of an object declaration in kotlin -

php - Doctrine Query Builder Error on Join: [Syntax Error] line 0, col 87: Error: Expected Literal, got 'JOIN' -