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 -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -