The Pipes you are talking about in the starting description are different from the pipe you showed in the example.
In Angular(2|4|5) Pipes are used to format view as you said. I think you have a basic understanding of pipes in Angular, you can learn more about that from this link - Angular Pipe Doc
The pipe()
you have shown in the example is the pipe()
method of RxJS 5.5 (RxJS is the default for all Angular apps). In Angular5 all the RxJS operators can be imported using single import and they are now combined using the pipe method.
tap()
- RxJS tap operator will look at the Observable value and do something with that value. In other words, after a successful API request, the tap()
operator will do any function you want it to perform with the response. In the example, it will just log that string.
catchError()
- catchError does exactly the same thing but with error response. If you want to throw an error or want to call some function if you get an error, you can do it here. In the example, it will call handleError()
and inside that, it will just log that string.