{"id":13481578,"url":"https://github.com/gangachris/ng-validators","last_synced_at":"2025-03-27T12:31:03.747Z","repository":{"id":65424493,"uuid":"220716293","full_name":"gangachris/ng-validators","owner":"gangachris","description":null,"archived":false,"fork":true,"pushed_at":"2018-03-16T18:10:10.000Z","size":235,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-23T02:34:19.637Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"xinxinw1/ng-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:21:42.000Z","updated_at":"2019-11-09T23:21:44.000Z","dependencies_parsed_at":"2023-01-23T10:55:20.285Z","dependency_job_id":null,"html_url":"https://github.com/gangachris/ng-validators","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gangachris%2Fng-validators","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gangachris%2Fng-validators/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gangachris%2Fng-validators/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gangachris%2Fng-validators/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gangachris","download_url":"https://codeload.github.com/gangachris/ng-validators/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245383036,"owners_count":20606265,"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-07-31T17:00:53.017Z","updated_at":"2025-03-27T12:31:03.468Z","avatar_url":"https://github.com/gangachris.png","language":null,"funding_links":[],"categories":["Uncategorized","Awesome Angular [![Awesome TipeIO](https://img.shields.io/badge/Awesome%20Angular-@TipeIO-6C6AE7.svg)](https://github.com/gdi2290/awesome-angular) [![Awesome devarchy.com](https://img.shields.io/badge/Awesome%20Angular-@devarchy.com-86BDC1.svg)](https://github.com/brillout/awesome-angular-components)"],"sub_categories":["Uncategorized","Angular \u003ca id=\"angular\"\u003e\u003c/a\u003e"],"readme":"# NGValidators\n\n[![Codacy Badge](https://api.codacy.com/project/badge/Grade/741550036db0422bbb09c51b685fb65c)](https://www.codacy.com/app/ganga-chris/ng-validators?utm_source=github.com\u0026utm_medium=referral\u0026utm_content=gangachris/ng-validators\u0026utm_campaign=badger)\n\nA List of validators for Angular (2 and above) 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 ng-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 { NGValidators } from 'ng-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, NGValidators.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","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgangachris%2Fng-validators","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgangachris%2Fng-validators","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgangachris%2Fng-validators/lists"}