diff --git a/aio/content/guide/styleguide.md b/aio/content/guide/styleguide.md index 36f08420f4..d2c53bdf4f 100644 --- a/aio/content/guide/styleguide.md +++ b/aio/content/guide/styleguide.md @@ -2759,6 +2759,30 @@ A typical *lazy loaded folder* contains a *routing component*, its child compone Back to top +### Do not add filtering and sorting logic to pipes + +#### Style 04-13 + +
+ +**Avoid** adding filtering or sorting logic into custom pipes. + +
+ +
+ +**Do** pre-compute the filtering and sorting logic in components or services before binding the model in templates. + +
+ +
+ +**Why?** Filtering and especially sorting are expensive operations. As Angular can call pipe methods many times per second, sorting and filtering operations can degrade the user experience severely for even moderately-sized lists. + +
+ +Back to top + ## Components {@a 05-03}