@moeindeveloper/ng-html-id
v1.0.0
Published
An helpful HTML id generator for angular projects
Downloads
2
Readme
NG-HTML-id
ng-html-id is a simple html id generator for angular projects
Installation
Use the package manager NPM to install ng-html-id.
npm install --save-dev @moeindeveloper/ng-html-id
Configuration
Create 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
{
"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
npx ng-html-id -C configuration.json
or
npx ng-html-id --config configuration.json
using predefined configuration
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.