{"id":13527807,"url":"https://github.com/hueitan/angular-validation","last_synced_at":"2025-05-15T18:09:14.699Z","repository":{"id":12483875,"uuid":"15153183","full_name":"hueitan/angular-validation","owner":"hueitan","description":"[INACTIVE] Client Side Validation for AngularJS 1. (You should use version \u003e 2 :boom:)","archived":false,"fork":false,"pushed_at":"2020-10-30T21:27:48.000Z","size":1377,"stargazers_count":702,"open_issues_count":17,"forks_count":176,"subscribers_count":28,"default_branch":"master","last_synced_at":"2025-05-08T17:04:50.618Z","etag":null,"topics":["angular","angularjs","javascript","validation","validations"],"latest_commit_sha":null,"homepage":"http://hueitan.github.io/angular-validation/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hueitan.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-12-13T02:39:08.000Z","updated_at":"2025-03-30T13:33:44.000Z","dependencies_parsed_at":"2022-09-10T23:57:05.235Z","dependency_job_id":null,"html_url":"https://github.com/hueitan/angular-validation","commit_stats":null,"previous_names":["huei90/angular-validation"],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hueitan%2Fangular-validation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hueitan%2Fangular-validation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hueitan%2Fangular-validation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hueitan%2Fangular-validation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hueitan","download_url":"https://codeload.github.com/hueitan/angular-validation/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254394722,"owners_count":22063984,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["angular","angularjs","javascript","validation","validations"],"created_at":"2024-08-01T06:02:02.536Z","updated_at":"2025-05-15T18:09:14.669Z","avatar_url":"https://github.com/hueitan.png","language":"JavaScript","readme":"angular-validation 1.4.5\n=========================\n[![NPM version](https://badge.fury.io/js/angular-validation.svg)](http://badge.fury.io/js/angular-validation)\n[![Build Status](https://travis-ci.org/hueitan/angular-validation.png?branch=master)](https://travis-ci.org/hueitan/angular-validation)\n[![Code Climate](https://codeclimate.com/github/hueitan/angular-validation/badges/gpa.svg)](https://codeclimate.com/github/hueitan/angular-validation)\n[![Coverage Status](https://coveralls.io/repos/hueitan/angular-validation/badge.svg?branch=master\u0026service=github)](https://coveralls.io/github/hueitan/angular-validation?branch=master)\n[![devDependency Status](https://david-dm.org/hueitan/angular-validation/dev-status.png)](https://david-dm.org/hueitan/angular-validation#info=devDependencies)\n\nClient-side Validation should be simple and clean.\n\u003cbr/\u003eDon't let Client-side Validation dirty your controller.\n\nSetup your Validation on config phase by using some rules [(example)](https://github.com/hueitan/angular-validation/blob/master/dist/angular-validation-rule.js)\n\u003cbr/\u003eIf you prefer schema over html attributes , try [angular-validation-schema\n](https://github.com/thetutlage/angular-validation-schema) [(Demo)](http://plnkr.co/edit/X56HEsDYgYoY8gbSj7cu?p=preview)\n\u003cbr/\u003eAnd add Validation in your view only.\n\nangularjs 1.2.x support to version [angular-validation 1.2.x](https://github.com/hueitan/angular-validation/tree/v1.2.x) \u003cbr/\u003e\nangularjs 1.3.x support after version [angular-validation 1.3.x](https://github.com/hueitan/angular-validation/tree/v1.3.x) \u003cbr/\u003e\nangularjs 1.4.x support after version angular-validation 1.4.x\n\nRequirement\n-----\n[AngularJS](http://angularjs.org) 1.2.x (for [angular-validation 1.2.x](https://github.com/hueitan/angular-validation/tree/v1.2.x)) \u003cbr/\u003e\n[AngularJS](http://angularjs.org) 1.3.x (for [angular-validation 1.3.x](https://github.com/hueitan/angular-validation/tree/v1.3.x)) \u003cbr/\u003e\n[AngularJS](http://angularjs.org) 1.4.x (for [angular-validation 1.4.x](https://github.com/hueitan/angular-validation/tree/master))\n\nDEMO\n-----\nhttp://hueitan.github.io/angular-validation/\n\nInstall\n-----\nInstall with npm\n\n```\nnpm install angular-validation\n```\n\nor with bower\n\n```\nbower install angular-validation\n```\n\nUsing angular-validation\n---\n```html\n\u003cscript src=\"dist/angular-validation.js\"\u003e\u003c/script\u003e\n\u003cscript src=\"dist/angular-validation-rule.js\"\u003e\u003c/script\u003e\n```\n```js\nangular.module('yourApp', ['validation']);\n\n// OR including your validation rule\nangular.module('yourApp', ['validation', 'validation.rule']);\n```\n\nWriting your First Code\n====\n```html\n\u003cform name=\"Form\"\u003e\n    \u003cdiv class=\"row\"\u003e\n        \u003cdiv\u003e\n            \u003clabel\u003eRequired\u003c/label\u003e\n            \u003cinput type=\"text\" name=\"required\" ng-model=\"form.required\" validator=\"required\"\u003e\n        \u003c/div\u003e\n        \u003cdiv\u003e\n            \u003clabel\u003eUrl\u003c/label\u003e\n            \u003cinput type=\"text\" name=\"url\" ng-model=\"form.url\" validator=\"required, url\"\u003e\n        \u003c/div\u003e\n        \u003cbutton validation-submit=\"Form\" ng-click=\"next()\"\u003eSubmit\u003c/button\u003e\n        \u003cbutton validation-reset=\"Form\"\u003eReset\u003c/button\u003e\n    \u003c/div\u003e\n\u003c/form\u003e\n```\n\n[Documentation API](https://github.com/hueitan/angular-validation/blob/master/API.md)\n\nBuilt-in validation \u003csmall\u003ein angular-validation-rule\u003c/small\u003e\n===\n\n1. Required\n2. Url\n3. Email\n4. Number\n5. Min length\n6. Max length\n\n5 and 6 require you to pass an inline parameter to set the length limit. Eg, `maxlength=6`.\n\nAnyone can give a `PR` for this angular-validation for more `built-in validation`\n\n\nIntegrating with Twitter Bootstrap\n=====\n\nTo integrate this package with Bootstrap you should do the following.\n\n\nAdd the following LESS to your project\n\n```css\n.ng-invalid.ng-dirty{\n    .has-error .form-control;\n}\n\nlabel.has-error.control-label {\n    .has-error .control-label;\n}\n\n```\n\nChange the Error HTML to something like:\n\n```javascript\n$validationProvider.setErrorHTML(function (msg) {\n       return  \"\u003clabel class=\\\"control-label has-error\\\"\u003e\" + msg + \"\u003c/label\u003e\";\n});\n```\n\nYou can add the bootstrap class `.has-success` in a similar fashion.\n\nTo toggle `.has-error` class on bootstrap `.form-group` wrapper for labels and controls, add:\n\n```javascript\nangular.extend($validationProvider, {\n    validCallback: function (element){\n        $(element).parents('.form-group:first').removeClass('has-error');\n    },\n    invalidCallback: function (element) {\n        $(element).parents('.form-group:first').addClass('has-error');\n    }\n});\n```\n\nLicense\n-----\nMIT\n\nCHANGELOG\n=====\nSee [release](https://github.com/hueitan/angular-validation/releases)\n\nCONTRIBUTORS\n=====\nThank you for your contribution [@lvarayut](https://github.com/lvarayut) and [@Nazanin1369](https://github.com/Nazanin1369) :heart: \u003cbr/\u003e\nThanks for all [contributors](https://github.com/hueitan/angular-validation/graphs/contributors)\n","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhueitan%2Fangular-validation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhueitan%2Fangular-validation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhueitan%2Fangular-validation/lists"}