Previously, one-time expressions were supposed to not trigger perf timers. There
were a couple of issues with the implementation:
One-time expressions were not detected as such if there was whitespace before
the ::.
It depended on internal AngularJS implementation details in a way that would
fail to identify certain usecases (e.g. multiple interpolations in a single
attribute value or node text).
Time spent on the initial evaluation of the one-time expressions would not be
accounted for, but could still impact the duration of the first $digest.
While it is not common, there are cases were one-time expressions don't
settle immediately. In such cases, their impact on the $digest should not
be ignored.
This commit fixes the above issues by ensuring that only the "final" call to
$watch is intercepted (in contrast to intermediate calls that might call a
$$watchDelegate, which will then create the actual $watcher). One-time
expressions are intercepted normally and stop triggering perf times as soon as
their unwatch function is called.
Although the dependency on internal AngularJS implementation details could not
be avoided, the new implementation is a little more robust, as it relies on
fewer and less brittle details :D
Previously, one-time expressions were supposed to not trigger perf timers. There were a couple of issues with the implementation:
::
.$digest
.$digest
should not be ignored.This commit fixes the above issues by ensuring that only the "final" call to
$watch
is intercepted (in contrast to intermediate calls that might call a$$watchDelegate
, which will then create the actual$watch
er). One-time expressions are intercepted normally and stop triggering perf times as soon as theirunwatch
function is called.Although the dependency on internal AngularJS implementation details could not be avoided, the new implementation is a little more robust, as it relies on fewer and less brittle details :D
Fixes #109 Closes #122