{"id":19945362,"url":"https://github.com/khashayar/ng-trim-value-accessor","last_synced_at":"2025-05-03T16:32:06.353Z","repository":{"id":38708220,"uuid":"81206102","full_name":"khashayar/ng-trim-value-accessor","owner":"khashayar","description":"Angular's (missing) trim accessor to automatically trim values of input fields","archived":false,"fork":false,"pushed_at":"2022-12-10T00:09:27.000Z","size":808,"stargazers_count":53,"open_issues_count":20,"forks_count":19,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-10-14T11:49:10.470Z","etag":null,"topics":["angular","trim"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/khashayar.png","metadata":{"files":{"readme":"README.MD","changelog":"CHANGELOG.md","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":"2017-02-07T12:34:52.000Z","updated_at":"2024-03-05T05:41:36.000Z","dependencies_parsed_at":"2023-01-25T20:30:42.494Z","dependency_job_id":null,"html_url":"https://github.com/khashayar/ng-trim-value-accessor","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khashayar%2Fng-trim-value-accessor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khashayar%2Fng-trim-value-accessor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khashayar%2Fng-trim-value-accessor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khashayar%2Fng-trim-value-accessor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/khashayar","download_url":"https://codeload.github.com/khashayar/ng-trim-value-accessor/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224367765,"owners_count":17299572,"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","trim"],"created_at":"2024-11-13T00:25:16.816Z","updated_at":"2024-11-13T00:25:17.321Z","avatar_url":"https://github.com/khashayar.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TrimValueAccessor for Angular\n\nAngular's missing trim input functionality (equivalent of AngularJS `ng-trim`)\n\n**Caveats:**\n\n* It's a drop-in solution, meaning it applies to all input fields as soon as this module is used.\n* It does not work with inputs that are already using another value accessor, since Angular only allows one value accessor per form control. This means it cannot be used with Angular Material inputs (the `matInput` directive uses a value accessor).\n\n## Installation\n\nTo install this library, run:\n\n```bash\n$ npm install ng-trim-value-accessor --save\n```\n\n## Usage\n\nIn your Angular `AppModule`:\n\n```typescript\nimport { NgModule } from '@angular/core';\nimport { TrimValueAccessorModule } from 'ng-trim-value-accessor';\n\n@NgModule({\n  imports: [\n    TrimValueAccessorModule\n  ]\n})\nexport class AppModule { }\n```\n\n## Opt-out\n\nBy default, it ignores all `readonly` and `input[type=\"password]` fields. For example the following field remains untouched:\n\n```html\n\u003cinput class=\"form-control\" name=\"startDate\" [(ngModel)]=\"model.startDate\" ngbDatepicker readonly\u003e\n```\n\nHowever if you want to *explicitly opt-out*, give a field `ng-trim-ignore` css class:\n\n```html\n\u003cinput type=\"text\" class=\"form-control ng-trim-ignore\" name=\"firstName\" [(ngModel)]=\"model.firstName\"\u003e\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkhashayar%2Fng-trim-value-accessor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkhashayar%2Fng-trim-value-accessor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkhashayar%2Fng-trim-value-accessor/lists"}