l**********n 发帖数: 8443 | 1 Consider, for example, a combobox where you can type text to filter the
available options. This sort of control could have ~150 items and still be
highly usable. If it has some extra feature (for example a specific class on
the currently selected option) you start to get 3-5 bindings per option.
Put three of these widgets on a page (e.g. one to select a country, the
other to select a city in said country, and the third to select a hotel) and
you are somewhere between 1000 and 2000 bindings already.
Or consider a data-grid in a corporate web application. 50 rows per page is
not unreasonable, each of which could have 10-20 columns. If you build this
with ng-repeats, and/or have information in some cells which uses some
bindings, you could be approaching 2000 bindings with this grid alone.
I find this to be a huge problem when working with AngularJS, and the only
solution I've been able to find so far is to construct widgets without using
two-way binding, instead using ngOnce, deregistering watchers and similar
tricks, or construct directives which builds the DOM with jQuery and DOM
manipulation. I feel this defeats the purpose of using Angular in the first
place. |
|