Angular Performance Optimization #1 - using pipes

Angular Performance Optimization #1 - using pipes

Efficient User

5 лет назад

7,833 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

Venkatachalam Muthu
Venkatachalam Muthu - 28.11.2022 13:00

Having A Doubt On This ! Instead Of Using Pipes We Can Use Ternary Operator Inside Interpolation. Right ? Which One Is Better And Recommend To Use ?

Ответить
Leito Hardy
Leito Hardy - 02.04.2021 11:42

The pipe is started only when the input data changes, and the function call in the template is triggered on each ChangeDetection called

Ответить
Vaisakh Rajagopal
Vaisakh Rajagopal - 08.03.2021 13:40

I had similar doubt for a long time. Should I use pipe or function in template ?

And found this behaviour template function get called repeatedly regardless of the value change and pipe get called only if the value changes.

But isnt it's confusing! why does Angular2 call the function blindly.

This behaviour make sense only if something changed in the parent(template level). For example if parent had a variable binding which got changed. As a side effect all its childs may require a re-render or refresh.

Actually I ended up here looking an answer for the it. Can you explain this.

Ответить
Learn with Avinash Dalvi
Learn with Avinash Dalvi - 16.09.2020 16:52

Its very helpful insights

Ответить
Jason Bhardwaj
Jason Bhardwaj - 12.05.2019 15:27

How did you create a pipe on the fly ?

Ответить
Ramachandran Annamalai
Ramachandran Annamalai - 05.09.2018 23:28

This makes sense... Good work Pandiyan :)

Ответить
duraim08
duraim08 - 02.09.2018 18:32

Good one concept. We are expecting more from you Pandiyan. Keep doing well.

Ответить
Prem kamban
Prem kamban - 02.09.2018 17:16

That was helpful @Pandiyan
Actually i started to work on ng days ago!
This really helped on understanding the usage of pipes .
It's better you can share the code used for the demo!

Looking forward to the upcoming videos.

Ответить