From the course: Angular: Testing and Debugging

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Common pipe errors

Common pipe errors - Angular Tutorial

From the course: Angular: Testing and Debugging

Start my 1-month free trial

Common pipe errors

- [Narrator] Pipes are a very powerful way to transform content without mutating the source data. But there are some common pitfalls you need to be aware of when building custom pipes. You must add your pipe to the declarations ray in the Ng Module decorator. If you don't, the compiler will fail and you'll get an error message saying "Angular can't find your pipe." The Angular CLI tool does this for you so there's nothing to worry about when you generate new pipes using Angular CLI. Pipes are pure by default. This means Angular executes the pipe only if it detects a change in a primitive value, like a string or boolean, or it detects a change in a reference to an object or an array. With pure pipes, Angular ignores changes to data inside objects and arrays. This keeps your app performant because it's much faster to check primitives and references than it is to do a deep scan of an object or an array. If you change data in an object or an array, you must replace the reference to that…

Contents