Skip to main contentNedix.io

Snippets

Log Pipe

src/app/pipes/log-pipe.pipe.ts
import { Pipe, PipeTransform } from '@angular/core';
@Pipe({
name: 'log',
})
export class LogPipe implements PipeTransform {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
transform(items: any[], callback: (item: any) => boolean): any {
console.log(items);
src/app/pipes/log-pipe.pipe.spec.ts
import { LogPipe } from './log-pipe.pipe';
describe('LogPipe', () => {
it('creates an instance', () => {
const pipe = new LogPipe();
expect(pipe).toBeNull();
});
});
src/app/services/shared/shared.module.ts
import { NgModule } from '@angular/core';
import { LogPipe } from '../../pipes/log-pipe.pipe';
@NgModule({
declarations: [
LogPipe,
],
exports: [
LogPipe,