Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(ui-view): change $viewContentLoading to pair with $viewContentLoaded
The old $viewContentLoaded event wasn't needed for the one internal client (ui-view) because ui-view always ignores that event and acts on a $stateChangeSuccess event that follows right behind anyway. And it wasn't as useful to external clients as it could be because it wasn't delivered on every view update -- it was delivered only on state transitions that activate a state defining a view, and didn't deal with inheritance. Also, neither $viewContentLoading nor $viewContentLoaded events contained the name of the view loading or loaded. This change makes $viewContentLoading and $viewContentLoaded be emitted always in pairs, before/after updateView does the work of actually loading the view, and both events include the name of the view being loaded. This is a breaking change for users of the old $viewContentLoading event that relied on it being broadcast from the root scope, the precise time it was broadcast, the fact that it wasn't always sent when a view is loaded even if $viewContentLoaded will be sent, or the "options" parameter that was emitted with it. If people rely on any of that behavior and we can't break it, then we can restore the old behavior but I think there needs to be some other event which is reliably paired with $viewContentLoaded and contains the view name, and I can't think of a better name than $viewContentLoading for that event. Closes angular-ui#685.
- Loading branch information