angular directives for twitter bootstrap forms
- angular@^1.4
- angular-messages@^1.4
- twitter bootstrap@^3
- font-awesome@^4
- browserify
Instead of writing the above code:
<divclass="form-group has-feedback" ng-class="{'has-success':form.field.$valid, 'has-error':form.field.$invalid && (form.$submitted || form.field.$dirty)}"><labelclass="control-label">Field</label><inputtype="text" ng-model="model.field" name="field" class="form-control" requiredng-minlength="3" aria-describedby="inputError2Status"><spanclass="form-control-feedback" aria-hidden="true"><iclass="fa" ng-class="form.field.$invalid && form.field.$dirty ? 'fa-exclamation-triangle':'fa-check'"></i></span><spanid="inputError2Status" class="sr-only">(error)</span><divclass="help-block" ng-if="form.field.$dirty || form.$submitted" ng-messages="form.field.$error" role="alert"><smallng-message="required">This field cannot be blank</small><smallng-message="minlength">Minimum length:</small><smallng-message="email">Invalid email address</small></div></div>just write:
<divclass="form-group"><labelclass="control-label">Field</label><inputtype="text" ng-model="model.field" name="field" class="form-control" requiredabf-show-feedbackng-minlength="3"></div>Check the example at docs/example/index.html.
varabf=require('angular-bootstrap-forms');angular.module('myApp',[abf.name]);- Unit tests using karma
- input[type=text] form-control
- input[type=email] form-control
- select form-control
- textarea form-control
- standalone build
- comprehensive documentation
