1

I have an array. to rendering that array i am using *ngFor inside for loop i am calculating some value using function but some how my function calling multiple time. Any one know why this kind of behaviour happening?

Denis Chizhik
  • 141
  • 1
  • 7
Pankaj Bisht
  • 986
  • 1
  • 8
  • 27
  • 1
    Please show us your code, we should then have a better understanding. We cannot help with this question with no code. – Jamie Rees Feb 02 '18 at 11:57
  • Please provide some code, it's hard to say without any example. You might be mixing up two things here. *ngFor (as mentioned in your post) is a structural directie which you use in your template. That's not the typical way to call methods inside your template. Maybe you mean a for loop in your controller? Either way, both ways define an iteration through something (i.e. a collection), so if you have a method inside of your iteration, it's normal that it's being called multiple times. – dave0688 Feb 02 '18 at 11:57
  • Post code so it might help to understand what's happening. – Munna Babu Feb 02 '18 at 11:57
  • If it's not a dupe, holler. – AT82 Feb 02 '18 at 20:20

0 Answers0