0.1.1 • Published 8 years ago
@dynatrace/ngx-groundhog-devkit v0.1.1
Angular Groundhog DevKit
Generating a new component in your ngx-groundhog lib project
You can use the ng generate (or just ng g) command to generate ngx-groundhog components:
ng generate groundhog-component my-new-component --collection @dynatrace/ngx-groundhog-devkit
ng g ghc my-new-component --collection @dynatrace/ngx-groundhog-devkit # using the aliasYou can find all possible blueprints in the table below:
| Scaffold | Usage |
|---|---|
| Component | ng g groundhog-component my-new-component |
Angular Groundhog - component
You can run the groundhog-component schematic with the following command inside the ngx-groundhog project
ng generate groundhog-component my-new-component --collection @dynatrace/ngx-groundhog-devkit
ng g ghc my-new-component --collection @dynatrace/ngx-groundhog-devkit # using the aliasThis will generate the following for you
- Add a folder inside
src/libwithmy-new-componentas it's name and add the following filesmy-new-component-module.tscontaining the NgModule definition with the exports and declarationsmy-new-component.tscontaining your components definitionmy-new-component.htmlmy-new-component.scssindex.tswith the export for the public-apipublic-api.tswith the export for the module and the componenttsconfig-build.jsonwith the correct flatModuleId set
- Add a folder inside the
src/demo-appwithmy-new-componentas it's name and add the following filesmy-new-component-demo.tscontaining the Demo component that display your component inside the demo appmy-new-component-demo.htmlmy-new-component-demo.scss
- Adds an export to the
public-api.tsin the library root - Adds the necessary declarations for the new component in the
demo-groundhog-module.tsfile - Adds the demo declarations to
routes.tsfor the new component - Adds a new navItem to the navItems collection in
demo-app.tsto show the new component in the navItems - Adds declarations to the
demo-app-module.ts - Adds mappings to the
system-config.tsfile