Infinite loop with Angular expression binding

后端 未结 2 1001
傲寒
傲寒 2020-11-30 11:43

I have an angular application that displays the value returned by a controller method through a simple expression binding:



        
2条回答
  •  暖寄归人
    2020-11-30 12:06

    I met the same problem as you, to fix the problem we can cache the results of the function. For this purpose I prefer to use Lo-Dash’s memoize function. I create a demo to show you how i managed to fix this problem.The following link contains the demo:http://plnkr.co/edit/KBmk4J2ZCt0SsmZlnKZi?p=preview

提交回复
热议问题