## Getting Started

### Requirements

AngularJS 1.2.x (for angular-validation 1.2.x)

AngularJS 1.3.x (for angular-validation 1.3.x)

### Installation

Install with npm

    npm install angular-validation

Or with Bower

    bower install angular-validation

### Files to download

Add the files to your html

    <script src="dist/angular-validation.js"></script>
    <script src="dist/angular-validation-rule.js"></script>

If you are using Bower:

    <script src="lib/angular-validation/dist/angular-validation.js"></script>
    <script src="lib/angular-validation/dist/angular-validation-rule.js"></script>

    angular.module('yourApp', ['validation']);

Including your validation rule

    angular.module('yourApp', ['validation', 'validation.rule']);

### Writing your first code

    <form name="Form">
            <div class="row">
                <div>
                    <label>Required</label>
                    <input type="text" name="required" ng-model="form.required" validator="required"></div>
                    <div>
                        <label>Url</label>
                        <input type="text" name="url" ng-model="form.url" validator="required, url">
                    </div>
                    <button validation-submit="Form" ng-click="next()">Submit</button>
                    <button validation-reset="Form">Reset</button>
            </div>
    </form>

## Style Guide

You can style different states of your form elements using the following selectors

Invalid Selectors

    .ng-invalid.ng-dirty { /* Your style here */ }

Valid Selectors

    .ng-valid.ng-dirty { /* Your style here */ }

You can also include your vendor libraries classes in you are using CSS preprocessors such as LESS or SASS.

Using Bootstrap classes

    .ng-valid.ng-dirty { .has-error .form-control; }

For more on AngularJS validation classes check at their documentation.

## Examples

Form ($watch)
Email Number

    <!-- default valid-method is watch -->
    <input type="text" name="emailBlur" ng-model="form.email" validator="email"/>

Form ($blur) Name Email

    <input type="text" name="emailBlur" ng-model="form.email" validator="email" valid-method="blur"/>

Form ($submit with callback) Required Url Email Number
Form (Additions validation)
With Function
type: Huei Tan no-validation-message
Change Error Msg Type Again #
Form ($submit-only) Required Email Lucky Number
Checkbox 1
Checkbox 2
Radio 1
Form (ng-repeat) Required

> In name attribute we have to use {{$index}} eg. emailRequiredOnly{{$index}}

Bootstrap DatePicker Required

AngularJs ui-select
Required, Selected: {{form8.country.selected}}
{{$select.selected.name}}