@actualwave/log-pipe
v0.0.2
Published
Angular Pipe that log values into console
Maintainers
Readme
@actualwave/log-pipe
This is simply a pipe that logs any received value into console. Check sandbox with an example on how to use the pipe.
Installation
npm install @actualwave/log-pipeCan be imported with module
import { LogPipeModule } from '@actualwave/log-pipe';
@NgModule({
imports: [
LogPipeModule,
...Use
Add log pipe to your interpolation
<span>{{ myValue | log }}</span>Your value will be rendered as is and logged into console. This pipe also supports any amount of arguments, they will be logged with the value.
<span>{{ myValue | log : 'One' : 'Two' }}</span>Will output to console
One Two Contents of myValueBy default, it sends log messages to console.log(), but this can be changed using CONSOLE injection token.
import { LogPipeModule, CONSOLE } from "@actualwave/log-pipe";
@NgModule({
imports: [LogPipeModule],
providers: [
{
provide: CONSOLE,
useValue: {
log: (...args: any[]) => sendLogAnywhere(...args)
}
}
],
})
export class AppModule {This package also includes logAsync and logThrough pipes that work with Observables. The difference is logThrough does not subscribe to observable.
