angular-bootstrap-show-errors
angular-bootstrap-show-errors copied to clipboard
Support for nested ngForm forms?
Hi,
very useful directive. But is there something planned (or an already existing approach) to easily support nested form validation? I know that doing it with a separate scope, like wrapping the form with a new controller would fix the issue, but isn't always wanted (as too much overhead for simple scenarios).
Currently the broadcast for showing validation errors is handled like...
scope.$on('show-errors-check-validity', function() {
return toggleClasses(formCtrl[inputName].$invalid);
});
where the formCtrl is the one being injected into the directive.
Do you think it would be feasible do change the current implementation in order to be able to "optionally" pass in the form on which the validation error should be shown. I.e. like this:
$scope.$broadcast('show-errors-check-validity', $scope.mySubForm);
I'd also be willing to submit a PR, just wanted to know whether there are already any ideas/approches on handling this.
Thx :smile:
+1
+1
+1 Any update?