{"id":16982077,"url":"https://github.com/tenphi/angular-bem","last_synced_at":"2025-08-06T08:03:13.119Z","repository":{"id":20401679,"uuid":"23677719","full_name":"tenphi/angular-bem","owner":"tenphi","description":"A set of directives to simplify your workflow with BEM-markup in Angular applications.","archived":false,"fork":false,"pushed_at":"2018-07-11T06:38:29.000Z","size":126,"stargazers_count":60,"open_issues_count":2,"forks_count":19,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-17T10:31:57.391Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/tenphi.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":"2014-09-04T20:12:34.000Z","updated_at":"2023-07-23T11:29:52.000Z","dependencies_parsed_at":"2022-08-25T20:40:47.021Z","dependency_job_id":null,"html_url":"https://github.com/tenphi/angular-bem","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/tenphi/angular-bem","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tenphi%2Fangular-bem","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tenphi%2Fangular-bem/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tenphi%2Fangular-bem/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tenphi%2Fangular-bem/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tenphi","download_url":"https://codeload.github.com/tenphi/angular-bem/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tenphi%2Fangular-bem/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268308296,"owners_count":24230005,"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","status":"online","status_checked_at":"2025-08-01T02:00:08.611Z","response_time":67,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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-14T02:07:14.733Z","updated_at":"2025-08-06T08:03:12.140Z","avatar_url":"https://github.com/tenphi.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# angular-bem\n\nA set of directives to simplify your workflow with [BEM](https://bem.info)-markup in [Angular](https://angularjs.org) (v2+) applications.\n\n[ANGULAR 1.X VERSION IS HERE](https://github.com/tenphi/angular-bem/tree/v1)\n\n## Changelog\n\n### 2.1.0\n* Support for Angular v6+\n* Refactoring\n\n### 2.0.0\n* Initial release for Angular v2+\n\n## Install\n\n```bash\n$ npm install angular-bem\n```\n\n## Example\nImport this module to your app:\n\n```javascript\nimport { BemModule } from 'angular-bem';\n\n@NgModule({\n  imports: [ BemModule ]\n})\nexport class AppModule {}\n```\n\nNow anywhere in your app you can use following syntax:\n\n```html\n\u003cdiv block=\"my-block\" mod=\"modName\"\u003e\n  \u003cdiv elem=\"my-element\" mod=\"modName secondModName\"\u003e\u003c/div\u003e\n\u003c/div\u003e\n```\n\nor\n\n```html\n\u003cdiv block=\"my-block\" [mod]=\"{ modName: true }\"\u003e\n  \u003cdiv elem=\"my-element\" [mod]=\"{ modName: true, secondModName: true }\"\u003e\u003c/div\u003e\n\u003c/div\u003e\n```\n\nInstead of `true` you can use any property from the component. Value `true` will add mod to the block (or elem) and `false` will remove it.\n\nAs a result of module's work the following markup may be produced:\n\n```html\n\u003cdiv class=\"my-block my-block--mod-name\"\u003e\n  \u003cdiv class=\"my-block__my-element my-block__my-element--mod-name my-block__my-element--second-mod-name\"\u003e\u003c/div\u003e\n\u003c/div\u003e\n```\n\nIf you use `string` or `number` as a value then this value will be used as addition for the mod class like `my-block__my-element--mod-name-value`.\n\n## Configuration\n\nYou can change module behaviour with BemConfig:\n\n```javascript\nimport { BemModule } from 'angular-bem';\n\nBemModule.config({\n  separators: ['__', '--', '-'], // el / mod / val separators\n  modCase: 'kebab', // case of modifiers names\n  ignoreValues: false // cast mod values to booleans\n}); // method returns BemModule\n```\n\nIt is recommended to set `ignoreValues` to `true` but it is set to `false` by default to support traditional bem-syntax.\n\n## Need to know\n* These directives don't affect scope or other directives. So you can use them at ease wherever you want.\n* You can only specify one element or block on single node. This limitation greatly simplify code of module and your app.\n* There is **no way** to create an element of parent block **inside** nested block. It's not a component-way. So please avoid it.\n\n## License\n\n[MIT](http://opensource.org/licenses/MIT) © [Andrey Yamanov](http://tenphi.me)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftenphi%2Fangular-bem","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftenphi%2Fangular-bem","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftenphi%2Fangular-bem/lists"}