*ngFor running an infinite loop in angular2

后端 未结 1 1826
别跟我提以往
别跟我提以往 2020-11-22 12:32

I am trying to render object properties using keys in angular2 using below code:

相关标签:
1条回答
  • 2020-11-22 13:09

    This is just Angular2 change detection at work calling loadProperty(i,element) over and over in each change detection cycle.

    Calling methods from the template is discouraged because they are called very often. You should instead store the result in a property and bind to this property instead.

    0 讨论(0)
提交回复
热议问题