@ppwcode/ng-common
v19.0.2
Published
This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 16.2.0.
Downloads
313
Keywords
Readme
NgCommon
This library was generated with Angular CLI version 16.2.0.
Code scaffolding
Run ng generate component component-name --project ng-common
to generate a new component. You can also use ng generate directive|pipe|service|class|guard|interface|enum|module --project ng-common
.
Note: Don't forget to add
--project ng-common
or else it will be added to the default project in yourangular.json
file.
Build
Run ng build ng-common
to build the project. The build artifacts will be stored in the dist/
directory.
Publishing
After building your library with ng build ng-common
, go to the dist folder cd dist/ng-common
and run npm publish
.
Running unit tests
Run ng test ng-common
to execute the unit tests via Karma.
Further help
To get more help on the Angular CLI use ng help
or go check out the Angular CLI Overview and Command Reference page.
Library contents
Mixins
Constructor
Defines a constructable type.
Handle subscriptions
Mixin to extend the given constructable with functionality to manage subscriptions. Provides the following:
- A function to wrap a stream with the PPW way of subscription handling.
- An ngOnDestroy implementation to automatically unsubscribe to all known subscriptions.
Track pending
Enhances the given base class with functionality for tracking a "pending" state. The initial state of the pending situation is "true".
Pipes
PpwApiTranslate
A pipe to translate properties of type PpwTranslationMap that come from the API to the current active locale.
RXJS Operators
TruthyFilter
An operator that only continues the stream when the incoming result is truthy
TruthyFirst
An operator that only continues the stream when the first incoming result is truthy