{"id":16326673,"url":"https://github.com/chrisyip/ng-attrs","last_synced_at":"2026-01-25T03:01:52.265Z","repository":{"id":30277452,"uuid":"33828953","full_name":"chrisyip/ng-attrs","owner":"chrisyip","description":"Dynamic set or remove attributes in Angular","archived":false,"fork":false,"pushed_at":"2015-04-13T06:16:14.000Z","size":154,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-11-11T06:16:09.572Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://chrisyip.github.io/ng-attrs","language":"HTML","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/chrisyip.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":"2015-04-12T18:44:42.000Z","updated_at":"2017-04-21T21:30:52.000Z","dependencies_parsed_at":"2022-08-28T09:41:40.983Z","dependency_job_id":null,"html_url":"https://github.com/chrisyip/ng-attrs","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/chrisyip/ng-attrs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrisyip%2Fng-attrs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrisyip%2Fng-attrs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrisyip%2Fng-attrs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrisyip%2Fng-attrs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chrisyip","download_url":"https://codeload.github.com/chrisyip/ng-attrs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrisyip%2Fng-attrs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28443457,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-15T05:05:00.929Z","status":"ssl_error","status_checked_at":"2026-01-15T05:04:58.515Z","response_time":62,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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-10T23:09:15.458Z","updated_at":"2026-01-25T03:01:52.244Z","avatar_url":"https://github.com/chrisyip.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ng-attrs\n\nDynamic set or remove attributes in Angular, like `ngClass` for classes.\n\n# Install\n\nBower:\n\n```\nbower install ng-attrs\n```\n\nOr manually download it.\n\n# Usage\n\n```html\n\u003c!-- For unmin version --\u003e\n\u003cscript src=\"bower_components/ng-attrs/ng-attrs.js\"\u003e\u003c/script\u003e\n\u003c!-- For min version --\u003e\n\u003cscript src=\"bower_components/ng-attrs/dist/ng-attrs.min.js\"\u003e\u003c/script\u003e\n\u003cscript\u003e\n  angular.module('yourApp', ['ngAttrs'])\n\u003c/script\u003e\n\u003cbody ng-app=\"yourApp\"\u003e\n  \u003cdiv ng-controller=\"yourCtrl\"\u003e\n    \u003cdiv ng-attrs=\"{ contenteditable: isEditable, 'custom-attr': isCustomAttr }\"\u003e\u003c/div\u003e\n  \u003c/div\u003e\n\u003c/body\u003e\n```\n\nThe different between [`ngAttr`](https://docs.angularjs.org/guide/directive#-ngattr-attribute-bindings) and `ngAttrs` is when value is:\n\n- `true`: `ngAttrs` will set attribute to `''`, useful for attribute that doesn't have value, e.g. `contenteditable`, `novalidate`; `ngAttr` will just set attribute to `'true'`, e.g. `contenteditable=\"true\"`.\n- `false` or `undefined`: `ngAttrs` will remove attribute from element, `ngAttr` will keep attribute without value.\n- Other data types, `ngAttrs` and `ngAttr` will convert it to `String` and set it as value.\n\n# Todo\n\n- Support package managers\n- Source map\n- Tests\n\n# Author\n\n[Chris Yip](https://github.com/chrisyip)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchrisyip%2Fng-attrs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchrisyip%2Fng-attrs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchrisyip%2Fng-attrs/lists"}