File tree Expand file tree Collapse file tree 3 files changed +16
-0
lines changed Expand file tree Collapse file tree 3 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -122,6 +122,18 @@ $validationProvider.setErrorHTML(function (msg) {
122122
123123You can add the bootstrap class ` .has-success ` in a similar fashion.
124124
125+ To toggle ` .has-error ` class on bootstrap ` .form-group ` wrapper for labels and controls, add:
126+
127+ ``` javascript
128+ angular .extend ($validationProvider, {
129+ validCallback : function (element ){
130+ $ (element).parents (' .form-group:first' ).removeClass (' has-error' );
131+ },
132+ invalidCallback : function (element ) {
133+ $ (element).parents (' .form-group:first' ).addClass (' has-error' );
134+ }
135+ });
136+ ```
125137
126138CHANGELOG
127139=====
Original file line number Diff line number Diff line change 3333 }
3434 ctrl . $setValidity ( ctrl . $name , true ) ;
3535 if ( scope . validCallback ) scope . validCallback ( ) ;
36+ if ( $validationProvider . validCallback ) $validationProvider . validCallback ( element ) ;
3637
3738 return true ;
3839 } ;
6465 }
6566 ctrl . $setValidity ( ctrl . $name , false ) ;
6667 if ( scope . inValidCallback ) scope . inValidCallback ( ) ;
68+ if ( $validationProvider . invalidCallback ) $validationProvider . invalidCallback ( element ) ;
6769
6870 return false ;
6971 } ;
Original file line number Diff line number Diff line change 265265 showErrorMessage : this . showErrorMessage ,
266266 checkValid : this . checkValid ,
267267 validate : this . validate ,
268+ validCallback : this . validCallback ,
269+ invalidCallback : this . invalidCallback ,
268270 reset : this . reset
269271 } ;
270272 }
You can’t perform that action at this time.
0 commit comments