Contents tagged with Custom Pipe

  • Building a custom pipe in AngularJS 2

    Hello everybody,

    today I want to write few words about custom pipes in ... AngularJS 2. The first time when I've heard about custom pipes happened to be when I've learned powershell scripting. And recently I've discovered that there are some built in custom pipes in AngularJS 2 and we can make our own custom pipes. 

    What is needed for implementing custom pipes? Nothing special. Just import from AngularJS 2 PipeTransform and implement in it method transform. And one more is pipe decorator ( in my example something that starts from @Pipe and ends with first }) ). And what else? Of course import statements.

    It can look like this:

    import {Pipe, PipeTransform} from '@angular/core'

    @Pipe( … more