{"id":22268716,"url":"https://github.com/paveldymkov/ng-track-by","last_synced_at":"2025-03-25T15:20:06.880Z","repository":{"id":85354564,"uuid":"393964645","full_name":"PavelDymkov/ng-track-by","owner":"PavelDymkov","description":null,"archived":false,"fork":false,"pushed_at":"2021-09-19T11:32:42.000Z","size":269,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-16T05:32:06.615Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PavelDymkov.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-08-08T13:13:32.000Z","updated_at":"2021-12-14T11:44:07.000Z","dependencies_parsed_at":"2023-03-03T03:46:34.915Z","dependency_job_id":null,"html_url":"https://github.com/PavelDymkov/ng-track-by","commit_stats":{"total_commits":4,"total_committers":1,"mean_commits":4.0,"dds":0.0,"last_synced_commit":"e38d1fe00ae727da92b19fd7a7025000c8495108"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PavelDymkov%2Fng-track-by","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PavelDymkov%2Fng-track-by/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PavelDymkov%2Fng-track-by/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PavelDymkov%2Fng-track-by/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PavelDymkov","download_url":"https://codeload.github.com/PavelDymkov/ng-track-by/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245486358,"owners_count":20623244,"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-12-03T11:13:37.958Z","updated_at":"2025-03-25T15:20:06.845Z","avatar_url":"https://github.com/PavelDymkov.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# trackBy and trackById directives\n\n![build passing](https://raw.githubusercontent.com/PavelDymkov/ng-track-by/master/badges/build.svg)\n![tests passing](https://raw.githubusercontent.com/PavelDymkov/ng-track-by/master/badges/tests.svg)\n![license](https://raw.githubusercontent.com/PavelDymkov/ng-track-by/master/badges/license.svg)\n\n\u003e Library for set a value of the ngForTrackBy without adding any code to a component using only a template.\n\n## Usage\n\nAdd directive(s) to module:\n\n```ts\nimport { CommonModule } from \"@angular/common\";\nimport { TrackByModule, TrackByIdModule } from \"ng-track-by\";\n\n@NgModule({\n    imports: [CommonModule, TrackByModule, TrackByIdModule],\n    declarations: [MyComponent],\n})\nexport class MyComponentModule {}\n```\n\nNow you can use `trackBy` and `trackById`:\n\n```html\n\u003cul *ngFor=\"let user of users\" trackBy=\"name\"\u003e\n    \u003cli\u003e{{ user.name }}\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cul *ngFor=\"let item of items\" trackById\u003e\n    \u003cli\u003e{{ item.value }}\u003c/li\u003e\n\u003c/ul\u003e\n```\n\nThe `trackById` is an alias for `trackBy=\"id\"`.\n\nThe `trackBy` directive specifies the key in item of a collection according to which compute the identity of items.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaveldymkov%2Fng-track-by","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpaveldymkov%2Fng-track-by","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaveldymkov%2Fng-track-by/lists"}