UNPKG

ddc-library-commons

Version:

Angular library for commons modules, components, services and more of the ddc project

82 lines (49 loc) 2.2 kB
# DdcLibraryCommons This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 12.2.0. ## Documentation ### Services #### Scroll This service allows go to the top of the application with the smooth effect or without it, to use it you must import it in this way ```sh import { ScrollDdcService } from 'ddc-library-commons'; ``` and after you must declare it in the constructor in this way ```sh constructor(private scrollService: ScrollDdcService) {}; ``` #### Route Status This service allows manage the metadata, to use it you must import it in this way ```sh import { RouteStatusDdcService } from 'ddc-library-commons'; ``` and after you must declare it in the constructor in this way ```sh constructor(private routeStatusService: RouteStatusDdcService) {}; ``` ### Components #### Breadcrumb breadcrumbs component shows where in the site hierarchy the user is, to use it you must to import this component in this way ```sh import { BreadcrumbComponent } from 'ddc-library-commons'; ``` and after you will be able to use it in the template with this selector ```sh ddc-breadcrumb ``` ### Utils - checkOverflow - overflowHeight - stringMapToJson - removeKeyFromObject - sortArrayByDate ## Code scaffolding Run `ng generate component component-name --project ddc-library-commons` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project ddc-library-commons`. > Note: Don't forget to add `--project ddc-library-commons` or else it will be added to the default project in your `angular.json` file. ## Build Run `ng build ddc-library-commons` to build the project. The build artifacts will be stored in the `dist/` directory. ## Publishing After building your library with `ng build ddc-library-commons`, go to the dist folder `cd dist/ddc-library-commons` and run `npm publish`. ## Running unit tests Run `ng test ddc-library-commons` to execute the unit tests via [Karma](https://karma-runner.github.io). ## Further help To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.