Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/moeindev/ng-html-id
ng-html-id is a simple html id generator for angular projects
https://github.com/moeindev/ng-html-id
angular angular-cli html idgenerator
Last synced: about 2 months ago
JSON representation
ng-html-id is a simple html id generator for angular projects
- Host: GitHub
- URL: https://github.com/moeindev/ng-html-id
- Owner: moeindev
- License: mit
- Created: 2023-09-08T08:50:28.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-09-10T11:10:01.000Z (over 1 year ago)
- Last Synced: 2024-10-19T02:14:50.571Z (3 months ago)
- Topics: angular, angular-cli, html, idgenerator
- Language: TypeScript
- Homepage:
- Size: 38.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# NG-HTML-id
ng-html-id is a simple html id generator for angular projects
## Installation
Use the package manager [NPM](https://www.npmjs.com) to install ng-html-id.
```bash
npm install --save-dev @moeindeveloper/ng-html-id
```
## ConfigurationCreate a configuration.json file at the root level of your project, you can add some suffixes to add to the id and define project name
```json
{
"projectName": "my-awesome-project",
"elementSuffixes": {
"button": "btn",
"div": "container",
"input": "input",
"p-button": "btn",
and any other selector names..
}
}```
## Usage
Run the command using NPX
```bash
npx ng-html-id -C configuration.json
```
or```bash
npx ng-html-id --config configuration.json
```using predefined configuration
```bash
npx ng-html-id
```## TODO
- Add support for ngFor and automatically add an id there.
- Support for custom compoent names.
- Add tests.## Contributing
Pull requests are welcome. For major changes, please open an issue first
to discuss what you would like to change.Please make sure to update tests as appropriate.
## License
[MIT](https://choosealicense.com/licenses/mit/)