@actualwave/terminator-pipe

Angular Pipe that passes empty string instead of original value

Usage no npm install needed!

<script type="module">
  import actualwaveTerminatorPipe from 'https://cdn.skypack.dev/@actualwave/terminator-pipe';
</script>

README

@actualwave/terminator-pipe

This is simply a pipe that does nothing and returns an empty string no matter what input it gets. Check sandbox with an example on how to use the pipe.

Installation

npm install @actualwave/terminator-pipe

Can be imported with module

import { TerminatorPipeModule } from '@actualwave/terminator-pipe';

@NgModule({
  imports: [
    TerminatorPipeModule,
    ...

Use

End your interpolation expression with terminator pipe and it will display nothing.

<span>{{ date$ | async | date | terminator }}</span>

This example is pointless, because whatever values date$ observable returns, in the end it will render nothing. terminator pipe has aliases t800 and T800 for your convenience.

<span>{{ judgmentDay | date | T800 }}</span>

Additionally, this package provides conditional terminator terminateIf(aliases t1000 and T1000) which also acceps boolean parameter to determine if value should be passed or violently terminated.

<span>{{ connor.John | terminateIf : approvedForTermination }}</span>