This repository has been archived by the owner on May 29, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
Infinite digest loop when using filters inside tooltip expression properties (like popover-html) #4429
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
change contentExp to evaluate using $parse instead of scope.$eval to make possible usage of filters inside expression
@RobJacobs what are your thoughts on this? This sounds like a good change IMO, since evaluating the attribute expression each time is inefficient. |
@wesleycho @forceuser I like where this is going but have a suggestion. Lets see if we can move the watch to the createTooltip function and replace the watch on line 229 for contentExp(), so that it would become:
That way, when the tooltipLinkedScope gets destroyed, so does the watch and that watch can serve both purposes (hide tooltip when template is empty). |
but the parent of tooltipLinkedScope is ttScope and it is isolated, so contentExpGetter may not return any value in tooltipLinkedScope.$watch |
jasonaden
pushed a commit
to deskfed/bootstrap
that referenced
this pull request
Jan 8, 2016
This is a rollup commit intended to address several issues around the positioning and parsing of attributes. - Fixes issue introduced under PR angular-ui#4311 where setting height and width in tooltip position function messed up arrow placement. - Fixes issue introduced under PR angular-ui#4363 where setting visibility to hidden in tooltip position function caused elements in popover to lose focus. - Fixes issue angular-ui#1780 where tooltip would render if content was just whitespace. - Fixes issue angular-ui#3347 where tooltip isolate scope was being accessed after it was set to null. Observers will now be created/destroyed as tooltip opens/closes which will also offer a performance improvement. - Fixes issue angular-ui#3557 by implementing evalAsync to set tooltip scope isOpen property. - Fixes issue angular-ui#4335 where if model isOpen property is undefined, tooltip would call show/hide toggle function. - Closes PR angular-ui#4429 where how the templated content was being evaluated could cause an infinite digest loop. Closes angular-ui#4400 Closes angular-ui#4418 Closes angular-ui#4429 Closes angular-ui#4431 Closes angular-ui#4455 Fixes angular-ui#1780 Fixes angular-ui#3347 Fixes angular-ui#3557 Fixes angular-ui#4321 Fixes angular-ui#4335
jasonaden
pushed a commit
to deskfed/bootstrap
that referenced
this pull request
Jan 8, 2016
This is a rollup commit intended to address several issues around the positioning and parsing of attributes. - Fixes issue introduced under PR angular-ui#4311 where setting height and width in tooltip position function messed up arrow placement. - Fixes issue introduced under PR angular-ui#4363 where setting visibility to hidden in tooltip position function caused elements in popover to lose focus. - Fixes issue angular-ui#1780 where tooltip would render if content was just whitespace. - Fixes issue angular-ui#3347 where tooltip isolate scope was being accessed after it was set to null. Observers will now be created/destroyed as tooltip opens/closes which will also offer a performance improvement. - Fixes issue angular-ui#3557 by implementing evalAsync to set tooltip scope isOpen property. - Fixes issue angular-ui#4335 where if model isOpen property is undefined, tooltip would call show/hide toggle function. - Closes PR angular-ui#4429 where how the templated content was being evaluated could cause an infinite digest loop. Closes angular-ui#4400 Closes angular-ui#4418 Closes angular-ui#4429 Closes angular-ui#4431 Closes angular-ui#4455 Fixes angular-ui#1780 Fixes angular-ui#3347 Fixes angular-ui#3557 Fixes angular-ui#4321 Fixes angular-ui#4335
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There is an error when using filters inside expression (as example
popover-html="'some html' | to_trusted"
) it caused infinite digest loop (Error message: [$rootScope:infdig] 10 $digest() iterations reached. Aborting!
).The reason is:
scope updates > triggers tooltipLinkedScope 'contentExp()' watcher > scope.$eval(attrs[type]) can again trigger update of the scope
I changed contentExp to evaluate using
$parse
instead ofscope.$eval
and moved it toscope
watcherNow contentExp() returns already evaluated value and can't cause infinite loop