Closed njoyard closed 8 years ago
FYI I pushed 3 working solutions on my fork. They all have the same visual result but different performance. To help testing I removed the 2-column mode and some container sizing is not quite right but that's not what matters right now, all this will be fixed.
From worst to best performance:
Feel free to tell me what you think about those. In all 3 cases performance is a bit hurt by the fact that we have a huge number of angular watchers (ng-repeat on subjects > ng-repeat on amendments > many dynamic properties). So I was wondering, given that we tell angular to identify amendments by their id_api, can we assume that a bunch of properties will never change on a given amendment (amdt number, group, title, authors for example) ? That would allow using one-time binding (ie. {{ ::value }}
) and only use dynamic binding for things that do change (such as amendment status).
What do you think @fmassot @RouxRC ?
Fixed by https://github.com/regardscitoyens/the-law-factory/commit/3f568a7d584beeaf6d6b10310efbed7588ed244b, uses "snake-swap" implementation. Feel free to keep commenting on other implementations, too.
Oops, not using the right array when rendering ; thus it's not really snake ordering. Should be an easy fix.
I also wanted to put one time binding everywhere we can, so this is excellent news !
same same for the ::value, didn't even know about it, excellent!
Lost when merging #129