{"id":18615063,"url":"https://github.com/andrewjbateman/angular-form-validation","last_synced_at":"2025-06-29T22:39:20.471Z","repository":{"id":38809584,"uuid":"158652058","full_name":"AndrewJBateman/angular-form-validation","owner":"AndrewJBateman","description":":clipboard: This app sets up form validation in Angular 10 using Template-Driven Forms. This is a simple registration form with standard fields for first name, last name, email, password and confirm password. Additional field with maxLength validator added.","archived":false,"fork":false,"pushed_at":"2023-03-02T13:30:29.000Z","size":1679,"stargazers_count":2,"open_issues_count":27,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-25T06:51:16.541Z","etag":null,"topics":["angular10","bootstrap","directive","forms-authentication","html5","typescript"],"latest_commit_sha":null,"homepage":"https://AndrewJBateman.github.io/angular-form-validation/","language":"TypeScript","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/AndrewJBateman.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-11-22T06:25:46.000Z","updated_at":"2024-02-07T18:45:29.000Z","dependencies_parsed_at":"2023-02-17T13:46:02.998Z","dependency_job_id":null,"html_url":"https://github.com/AndrewJBateman/angular-form-validation","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/AndrewJBateman%2Fangular-form-validation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndrewJBateman%2Fangular-form-validation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndrewJBateman%2Fangular-form-validation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndrewJBateman%2Fangular-form-validation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AndrewJBateman","download_url":"https://codeload.github.com/AndrewJBateman/angular-form-validation/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248322238,"owners_count":21084333,"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":["angular10","bootstrap","directive","forms-authentication","html5","typescript"],"created_at":"2024-11-07T03:27:59.922Z","updated_at":"2025-04-11T00:31:01.476Z","avatar_url":"https://github.com/AndrewJBateman.png","language":"TypeScript","readme":"# :zap: Angular Form Validation\n\n* This app sets up form validation in Angular 10 using Template-Driven Forms.\n* This is a simple registration form with standard fields for first name, last name, email, password and confirm password. Additional field with maxLength validator added.\n* Code from [Blog by Jason Watmore:](http://jasonwatmore.com/post/2018/11/10/angular-7-template-driven-forms-validation-example) - see [:clap: Inspiration](#clap-inspiration) below.\n* Not to be upgraded from Angular 10.\n\n*** Note: to open web links in a new window use: _ctrl+click on link_**\n\n## :page_facing_up: Table of contents\n\n* [:zap: Angular Form Validation](#zap-angular-form-validation)\n  * [:page_facing_up: Table of contents](#page_facing_up-table-of-contents)\n  * [:books: General info](#books-general-info)\n  * [:camera: Screenshots](#camera-screenshots)\n  * [:signal_strength: Technologies](#signal_strength-technologies)\n  * [:floppy_disk: Setup](#floppy_disk-setup)\n  * [:computer: Code Examples](#computer-code-examples)\n  * [:cool: Features](#cool-features)\n  * [:clipboard: Status \u0026 To-Do List](#clipboard-status--to-do-list)\n  * [:clap: Inspiration](#clap-inspiration)\n  * [:file_folder: License](#file_folder-license)\n  * [:envelope: Contact](#envelope-contact)\n\n## :books: General info\n\n* Input fields of main form have validation so incorrect inputs trigger a red boundary around the input field and an error message.\n* Styling of the template-driven forms is done using Bootstrap.\n\n## :camera: Screenshots\n\n![Example screenshot](./img/form-validation.png).\n\n## :signal_strength: Technologies\n\n* [Angular v10](https://angular.io/)\n* [Bootstrap v4](https://getbootstrap.com/) component library used.\n\n## :floppy_disk: Setup\n\n* Install dependencies using `npm i`.\n* Run `ng serve` for a dev server.\n* Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.\n\n## :computer: Code Examples\n\n* div with firstName field entry that is validated using a validator and directive called MustMatch\n\n```typescript\n\u003cdiv class=\"form-group\"\u003e\n  \u003clabel for=\"firstName\"\u003eFirst Name\u003c/label\u003e\n  \u003cinput\n    class=\"form-control\"\n    name=\"firstName\"\n    [(ngModel)]=\"model.firstName\"\n    #firstName=\"ngModel\"\n    [ngClass]=\"{ 'is-invalid': f.submitted \u0026\u0026 firstName.invalid }\"\n    required\n  /\u003e\n  \u003cdiv *ngIf=\"f.submitted \u0026\u0026 firstName.invalid\" class=\"invalid-feedback \"\u003e\n    \u003cdiv *ngIf=\"firstName?.errors.required\"\u003e\n      First Name is required\n    \u003c/div\u003e\n  \u003c/div\u003e\n\u003c/div\u003e\n```\n\n## :cool: Features\n\n* All fields are required, the email field must be a valid email address and the password field must have a min length of 6.\n* A custom validator and directive called MustMatch is used to validate that the confirm password and password fields match.\n* The form validates on submit rather than as soon as each field is changed, this is implemented using the f.submitted property of the #f=\"ngForm\" template variable which is true after the form is submitted for the first time.\n\n## :clipboard: Status \u0026 To-Do List\n\n* Status: Working.\n* To-Do: Nothing.\n\n## :clap: Inspiration\n\n* [Blog by Jason Watmore: Angular 7 - Template-Driven Forms Validation Example](http://jasonwatmore.com/post/2018/11/10/angular-7-template-driven-forms-validation-example).\n\n## :file_folder: License\n\n* This project is licensed under the terms of the MIT license.\n\n## :envelope: Contact\n\n* Repo created by [ABateman](https://github.com/AndrewJBateman), email: gomezbateman@yahoo.com\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrewjbateman%2Fangular-form-validation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandrewjbateman%2Fangular-form-validation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrewjbateman%2Fangular-form-validation/lists"}