Thank you so much Sander,
Agreed, I will try your approach.

Thanks,
Ajit

On Sat, Jun 20, 2020 at 12:05 AM Sander Elias <sanderel...@gmail.com> wrote:

> Ajit,
>
> I can repeat my previous reply. Using functions in templates is an
> antipattern in Angular, and should be a last-stop solution. Each of those
> functions is called numerous times. This will cause a performance hit. What
> you can do is some memorization in the functions itself.
> A better solution would be adding the needed data to the rows itself.
> In cases like this I usually so something in my controller like this:
> rows.forEach(row=>row[className]=calculate(...))
>
> and use the className in the template. This will only run once when the
> data comes in. after that, it is a simple lookup in the template.
>
> regards,
> Sander
>
> --
> You received this message because you are subscribed to the Google Groups
> "Angular and AngularJS discussion" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to angular+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/angular/df539074-0cc8-4510-aea9-9bf8183394bfo%40googlegroups.com
> <https://groups.google.com/d/msgid/angular/df539074-0cc8-4510-aea9-9bf8183394bfo%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/angular/CAGSnwRd0zm6NDim6uNoCV4OWfgtyb0Wk1wfo5TvSp9wDd_9_VQ%40mail.gmail.com.

Reply via email to