All Projects → hueitan → Angular Validation

hueitan / Angular Validation

[INACTIVE] Client Side Validation for AngularJS 1. (You should use version > 2 💥)

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Angular Validation

Valdr
A model centric approach to AngularJS form validation
Stars: ✭ 158 (-77.87%)
Mutual labels:  validation, angularjs
Vee Validate
✅ Form Validation for Vue.js
Stars: ✭ 8,820 (+1135.29%)
Mutual labels:  validation, validations
Angular Validate
Painless form validation for AngularJS. Powered by the jQuery Validation Plugin.
Stars: ✭ 71 (-90.06%)
Mutual labels:  validation, angularjs
Validateur
Functional validations inspired by Ruby's ActiveModel
Stars: ✭ 186 (-73.95%)
Mutual labels:  validation, validations
Angular Validation
AngularJS Form Validation made simple
Stars: ✭ 243 (-65.97%)
Mutual labels:  validation, angularjs
Validator.js
String validation
Stars: ✭ 18,842 (+2538.94%)
Mutual labels:  validation, validations
Valiktor
Valiktor is a type-safe, powerful and extensible fluent DSL to validate objects in Kotlin
Stars: ✭ 267 (-62.61%)
Mutual labels:  validation, validations
Approvejs
A simple JavaScript validation library that doesn't interfere
Stars: ✭ 336 (-52.94%)
Mutual labels:  validation, validations
Vue Composable
Vue composition-api composable components. i18n, validation, pagination, fetch, etc. +50 different composables
Stars: ✭ 638 (-10.64%)
Mutual labels:  validation
Vuelidate
Simple, lightweight model-based validation for Vue.js
Stars: ✭ 6,186 (+766.39%)
Mutual labels:  validation
Validation
The most awesome validation engine ever created for PHP
Stars: ✭ 5,484 (+668.07%)
Mutual labels:  validation
Heatmap.js
🔥 JavaScript Library for HTML5 canvas based heatmaps
Stars: ✭ 5,685 (+696.22%)
Mutual labels:  angularjs
Envalid
Environment variable validation for Node.js
Stars: ✭ 684 (-4.2%)
Mutual labels:  validation
Intl Tel Input
A JavaScript plugin for entering and validating international telephone numbers
Stars: ✭ 5,963 (+735.15%)
Mutual labels:  validation
Encoding
Go package containing implementations of efficient encoding, decoding, and validation APIs.
Stars: ✭ 705 (-1.26%)
Mutual labels:  validation
Marshmallow
A lightweight library for converting complex objects to and from simple Python datatypes.
Stars: ✭ 5,857 (+720.31%)
Mutual labels:  validation
Guides
Article back-end for hack.guides() website
Stars: ✭ 628 (-12.04%)
Mutual labels:  angularjs
Swagger Parser
Swagger 2.0 and OpenAPI 3.0 parser/validator
Stars: ✭ 710 (-0.56%)
Mutual labels:  validation
Validatedpropertykit
Easily validate your Properties with Property Wrappers 👮
Stars: ✭ 701 (-1.82%)
Mutual labels:  validation
Malli
Data-Driven Schemas for Clojure/Script.
Stars: ✭ 667 (-6.58%)
Mutual labels:  validation

angular-validation 1.4.5

NPM version Build Status Code Climate Coverage Status devDependency Status

Client-side Validation should be simple and clean.
Don't let Client-side Validation dirty your controller.

Setup your Validation on config phase by using some rules (example)
If you prefer schema over html attributes , try angular-validation-schema (Demo)
And add Validation in your view only.

angularjs 1.2.x support to version angular-validation 1.2.x
angularjs 1.3.x support after version angular-validation 1.3.x
angularjs 1.4.x support after version angular-validation 1.4.x

Requirement

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

DEMO

http://hueitan.github.io/angular-validation/

Install

Install with npm

npm install angular-validation

or with bower

bower install angular-validation

Using angular-validation

<script src="dist/angular-validation.js"></script>
<script src="dist/angular-validation-rule.js"></script>
angular.module('yourApp', ['validation']);

// OR 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>

Documentation API

Built-in validation in angular-validation-rule

  1. Required
  2. Url
  3. Email
  4. Number
  5. Min length
  6. Max length

5 and 6 require you to pass an inline parameter to set the length limit. Eg, maxlength=6.

Anyone can give a PR for this angular-validation for more built-in validation

Integrating with Twitter Bootstrap

To integrate this package with Bootstrap you should do the following.

Add the following LESS to your project

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

label.has-error.control-label {
    .has-error .control-label;
}

Change the Error HTML to something like:

$validationProvider.setErrorHTML(function (msg) {
       return  "<label class=\"control-label has-error\">" + msg + "</label>";
});

You can add the bootstrap class .has-success in a similar fashion.

To toggle .has-error class on bootstrap .form-group wrapper for labels and controls, add:

angular.extend($validationProvider, {
    validCallback: function (element){
        $(element).parents('.form-group:first').removeClass('has-error');
    },
    invalidCallback: function (element) {
        $(element).parents('.form-group:first').addClass('has-error');
    }
});

License

MIT

CHANGELOG

See release

CONTRIBUTORS

Thank you for your contribution @lvarayut and @Nazanin1369 ❤️
Thanks for all contributors

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].