{"id":16881851,"url":"https://github.com/dennisxzx/angular-template-driven-form-example","last_synced_at":"2026-01-19T08:32:25.046Z","repository":{"id":38695044,"uuid":"209165452","full_name":"dennisXZX/Angular-template-driven-form-example","owner":"dennisXZX","description":null,"archived":false,"fork":false,"pushed_at":"2023-01-07T09:49:16.000Z","size":1727,"stargazers_count":0,"open_issues_count":26,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-14T04:43:57.075Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/dennisXZX.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":"2019-09-17T22:09:19.000Z","updated_at":"2019-09-17T22:10:44.000Z","dependencies_parsed_at":"2023-02-06T20:30:54.829Z","dependency_job_id":null,"html_url":"https://github.com/dennisXZX/Angular-template-driven-form-example","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/dennisXZX%2FAngular-template-driven-form-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dennisXZX%2FAngular-template-driven-form-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dennisXZX%2FAngular-template-driven-form-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dennisXZX%2FAngular-template-driven-form-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dennisXZX","download_url":"https://codeload.github.com/dennisXZX/Angular-template-driven-form-example/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247796476,"owners_count":20997571,"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-10-13T16:05:18.763Z","updated_at":"2026-01-19T08:32:25.040Z","avatar_url":"https://github.com/dennisXZX.png","language":"TypeScript","readme":"### Angular Template Driven Form Example\n\nIn order to use Angular template driven form, you need to first import `FormsModule` into your Angular app.\n\nWhen you have the `FormsModule` imported, Angular would look for \u003cform\u003e tag and internally add an `NgForm` directive `\u003cform NgForm\u003e` and create an instance of `NgForm`. You can access this instance by using a template reference `\u003cform #userSettingsForm=\"ngForm\"\u003e`\n\nTo hook up a form input with the `ngForm` instance, you need to add `NgModel` to the form input and also give it a `name` attribute.\n\nHowever, if you need to enable two-way data binding, you would need to use the `[(ngModel)]=\"userSettings.name\"` in the template.\n\n### Validation\n\nAngular form comes with these CSS classes for validation purpose.\n\n- `ng-untouched` and `ng-touched`\n- `ng-pristine` (unmodified) and `ng-dirty` (modified)\n- `ng-valid` and `ng-invalid`\n\nAlso `NgModel` has properties associated with the CSS classes, for example, `userSettingsForm.valid` and `userSettingsForm.untouched`.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdennisxzx%2Fangular-template-driven-form-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdennisxzx%2Fangular-template-driven-form-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdennisxzx%2Fangular-template-driven-form-example/lists"}