angular-bootstrap-show-errors icon indicating copy to clipboard operation
angular-bootstrap-show-errors copied to clipboard

Support for nested ngForm forms?

Open juristr opened this issue 10 years ago • 3 comments

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:

juristr avatar Apr 17 '15 12:04 juristr

+1

hardlick avatar Jun 25 '15 00:06 hardlick

+1

rodp82 avatar Jan 06 '16 01:01 rodp82

+1 Any update?

shubhamkumarnayak avatar Feb 07 '19 20:02 shubhamkumarnayak