datepicker: reduce watchers #3770
One-time bindings will continue to watch until the value becomes anything other than undefined. As such, must set this to null when it is known, otherwise watchers will stick around.
Now use at most one watcher for determining which date should have what class. ng-class adds a watcher per element containing date, while this uses one watcher per class for all elements.
This PR looks good in terms of reducing the number of watchers. The issue that I see for many users is that the popup is always rendered even when not visible. The display is simply set to none. This leaves all of the watchers. When using multiple datepickers on a single page (or in a grid as some users have done) the number of watchers still becomes unwieldy even with the above reduced number of watchers. Are there any plans to conditionally render (ng-if) the popup when clicked.
I see that this ticket does in fact accomplish the task of reducing the watcher count on the datepicker and is not exactly tailored to the use case of multiple watchers. I ask here, however, because all datepicker watcher related tickets seem to lead me here