Improving nested ng-repeat + directive performance

江枫思渺然 提交于 2019-11-29 10:47:45

In this case it sounds like you're rendering a lot more information that would be able to be visible at any one time. So you could:

  • Rethink the interface with some sort of pagination, so you only render a screen of information at any one time. Or maybe a limit on the number of weeks you can show at any one time.

  • Create some sort of directive that removes its contents (i.e. via an ngIf) if its not visible on the screen. Perhaps listening to (a debounced) scroll event on the window, and calling functions from http://verge.airve.com/ to test if any part of it is visible. It might be tricky to sort out the vertical sizes of the elements in this case, so it slightly depends on your use-case.

    To clarify, this would have to remove the contents before it gets rendered by Angular, and not just hide the elements.

Hei, "assigment" is a directive, right? maybe you should paste the directive code here as well.

I once ran into the rendering delay, caused by ng-bind-html, don't know if you used it.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!