NgxFormControlErrorsLibrary
Based off @ngneat/error-tailor a dynamic approach to generating Reactive Form Error messages using directives.
Development server
Run ng serve
for a dev server. Navigate to http://localhost:4200/
. The app will automatically reload if you change any of the source files.
Code scaffolding
Run ng generate component component-name
to generate a new component. You can also use ng generate directive|pipe|service|class|guard|interface|enum|module
.
Build
Run ng build
to build the project. The build artifacts will be stored in the dist/
directory. Use the --prod
flag for a production build.
Note: Rebuild package to update local reference to NgxFormControlErrorsModule in app.module
npm run build:lib:prod
The test project references the local package located in the dist/
folder.
CSS Naming Convention
Try to follow BEM. Itβs one of the most commonly used convention by now. (double dash) means variation of the element. (double underscore) means children of the element.
Example
<button class='btn btn--warning'> <!-- .btn--warning one of the variation of .btn-->
<div class="btn__text"></div> <!-- .btn__text one of the child of .btn-->
</button>
.btn--warning {
/* Yay ! By convention, I know that code here relate to the variation "warning" of a button, without event looking at the HMTL code. What a relief !*/
}
.btn__text {
/* For same reason, I know that this style will target text in a button */
}
Running unit tests
Run ng test
to execute the unit tests via Karma.
Running end-to-end tests
Run ng e2e
to execute the end-to-end tests via Protractor.
Further help
To get more help on the Angular CLI use ng help
or go check out the Angular CLI README.
TODO's
- Rename package
- Fix tests in shared lib