{"id":13535542,"url":"https://github.com/gangachris/angular2-validators","last_synced_at":"2025-04-02T01:31:06.841Z","repository":{"id":57179783,"uuid":"220716415","full_name":"gangachris/angular2-validators","owner":"gangachris","description":"[DEPRECATED] Since the community is moving to just calling it Angular, this has been moved to https://github.com/gangachris/ng-validators","archived":false,"fork":true,"pushed_at":"2017-01-01T08:43:50.000Z","size":46,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-06T06:20:36.268Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"margierain/angular2-validators","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gangachris.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-11-09T23:23:15.000Z","updated_at":"2020-02-14T14:07:58.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/gangachris/angular2-validators","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gangachris%2Fangular2-validators","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gangachris%2Fangular2-validators/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gangachris%2Fangular2-validators/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gangachris%2Fangular2-validators/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gangachris","download_url":"https://codeload.github.com/gangachris/angular2-validators/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246738534,"owners_count":20825796,"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":[],"created_at":"2024-08-01T08:00:58.050Z","updated_at":"2025-04-02T01:31:06.561Z","avatar_url":"https://github.com/gangachris.png","language":null,"readme":"**[DEPRECATED]** Since the community is moving to just calling it Angular, this has been moved to https://github.com/gangachris/ng-validators\n\n# Ng2 Validators\nA List of validators for Angular 2 Forms based on [validator.js](https://github.com/chriso/validator.js). Current version only works with ReactiveFormsModule.\nFormsModule Directive validators will come soon.\n\n# Usage\n## Install\n```bash\n$ npm install --save angular2-validators\n```\n\n## Use as Model Based Validators\nMake sure you have ReactiveFormsModule imported in your modules.\n```typescript\nimport { BrowserModule } from '@angular/platform-browser';\nimport { NgModule } from '@angular/core';\nimport { ReactiveFormsModule } from '@angular/forms';\n\nimport { AppComponent } from './app.component';\n\n@NgModule({\n  declarations: [\n    AppComponent\n  ],\n  imports: [\n    BrowserModule,\n    ReactiveFormsModule,\n  ],\n  providers: [],\n  bootstrap: [AppComponent]\n})\nexport class AppModule { }\n```\n\nThe use the Validators with FormControls\n\n```typescript\nimport { Component } from '@angular/core';\n\nimport { FormGroup, FormBuilder, Validators } from '@angular/forms';\n\nimport { NG2Validators } from 'angular2-validators';\n\n@Component({\n  selector: 'app-root',\n  template: `\n      \u003cform [formGroup]=\"theForm\" novalidate\u003e\n          \u003clabel for=\"name\"\u003eEmail\u003c/label\u003e\n          \u003cinput type=\"text\" class=\"form-control\" name=\"email\" formControlName=\"email\"\u003e\n      \u003c/form\u003e\n  `,\n})\nexport class AppComponent {\n  theForm: FormGroup;\n\n  constructor(private fb: FormBuilder) {\n    this.theForm = fb.group({\n      email: ['', [Validators.required, NG2Validators.isEmail]]\n    });\n  }\n}\n```\n\n## Contributing\nContribution Guideline isn't available yet, but PRs are so welcome to the develop branch.\n\n## Added Validators\n* isAfter\n* isAlpha\n* isAlphanumeric\n* isAscii\n* isBase64\n* isBefore\n* isBoolean\n* isByteLength\n* isCreditCard\n* isCurrency\n* isDataUri\n* isDate\n* isDecimal\n* isEmail\n* isFloat\n* isFQDN\n* isHexColor\n* isHexaDecimal\n* isInt\n* isIP\n* isISBN\n* isJSON\n* isLowerCase\n* isMacAddress\n* isNull\n* isNumeric\n* isUpperCase\n* isURL\n","funding_links":[],"categories":["Uncategorized"],"sub_categories":["Uncategorized"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgangachris%2Fangular2-validators","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgangachris%2Fangular2-validators","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgangachris%2Fangular2-validators/lists"}