You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This bug is a regression from 0.2.10. It was caused by commit #7b78edee where $viewContentLoading events were allowed to be broadcast during $view.load.
$view.load fires the $viewContentLoading event. The event synchronously triggers an updateView. updateView doesn't know it's being re-entered and re-transcludes, which loads the template/controller. The controller calls state.go and the state is re-resolved. The fix involves setting latestLocals before loading the template and controller, so the next updateView early-exits.
Also of note, '$uiViewName' is not used anywhere else. With the getUiViewName function, it's not necessary any more for this code. Theoretically, somebody else might be using it outside of UI-Router, but if not it could be simplified like so:
if (!firstTime && previousLocals === latestLocals) return; // nothing to do
latestLocals = $state.$current.locals[name];
var clone = $transclude(newScope, function(clone) {
renderer.enter(clone, $element, function onUiViewEnter() {
if (angular.isDefined(autoScrollExp) && !autoScrollExp || scope.$eval(autoScrollExp)) {
$uiViewScroll(clone);
}
});
cleanupLastView();
});
Test case and PR coming soon.
The text was updated successfully, but these errors were encountered: