From the course: Angular: Testing and Debugging
Unlock the full course today
Join today to access over 24,800 courses taught by industry experts.
Common pipe errors - Angular Tutorial
From the course: Angular: Testing and Debugging
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
-
-
-
-
-
(Locked)
Adding a local storage service4m 38s
-
(Locked)
Fixing dependency injection errors3m 38s
-
(Locked)
Getting and setting data in local storage3m 18s
-
(Locked)
Adding a custom Angular pipe4m 51s
-
Using regular expressions to find content4m 13s
-
(Locked)
Using a pipe to change HTML content4m 17s
-
(Locked)
Common pipe errors1m 53s
-
(Locked)
Understanding Angular decorators2m 6s
-
(Locked)
Challenge: Filter the array of users by locationId30s
-
(Locked)
Solution: Filter the array of users by locationId1m 23s
-
(Locked)
-
-
-
-
-