3

I am struggling with slow rendering of ui-calendar whenever I change the date range. On an average month, I have up to 300 events. I have read that the Angular watches on the events are what is slowing the rendering down.

For the application I'm working on, I do not need watches on the events once they are rendered. What's the easiest way to remove those watches? Can I expect this to improve the performance of the calendar?

1 Answers1

0

Check out bindonce here. I believe this is built into framework starting with v1.3. Nice blog with examples here. Basically inside your template you would use:

<p>Hello {{::vm.name}}!</p>

This double colon would bind the vm.name variable defined in controller only once (first time it is changed) and then angular would stop watching the variable afterwards.

dwp4ge
  • 1,963
  • 22
  • 27