@@ -180,9 +180,6 @@ function $ViewDirective( $state, $injector, $uiViewScroll, $interpolate)
180180 scope . $on ( '$stateChangeSuccess' , function ( ) {
181181 updateView ( false ) ;
182182 } ) ;
183- scope . $on ( '$viewContentLoading' , function ( ) {
184- updateView ( false ) ;
185- } ) ;
186183
187184 updateView ( true ) ;
188185
@@ -216,6 +213,20 @@ function $ViewDirective( $state, $injector, $uiViewScroll, $interpolate)
216213 newScope = scope . $new ( ) ;
217214 latestLocals = $state . $current . locals [ name ] ;
218215
216+ /**
217+ * @ngdoc event
218+ * @name ui.router.state.directive:ui-view#$viewContentLoading
219+ * @eventOf ui.router.state.directive:ui-view
220+ * @eventType emits on ui-view directive scope
221+ * @description
222+ *
223+ * Fired once the view **begins loading**, *before* the DOM is rendered.
224+ *
225+ * @param {Object } event Event object.
226+ * @param {string } viewName Name of the view.
227+ */
228+ newScope . $emit ( '$viewContentLoading' , name ) ;
229+
219230 var clone = $transclude ( newScope , function ( clone ) {
220231 renderer . enter ( clone , $element , function onUiViewEnter ( ) {
221232 if ( currentScope ) {
@@ -236,12 +247,13 @@ function $ViewDirective( $state, $injector, $uiViewScroll, $interpolate)
236247 * @name ui.router.state.directive:ui-view#$viewContentLoaded
237248 * @eventOf ui.router.state.directive:ui-view
238249 * @eventType emits on ui-view directive scope
239- * @description *
250+ * @description
240251 * Fired once the view is **loaded**, *after* the DOM is rendered.
241252 *
242253 * @param {Object } event Event object.
254+ * @param {string } viewName Name of the view.
243255 */
244- currentScope . $emit ( '$viewContentLoaded' ) ;
256+ currentScope . $emit ( '$viewContentLoaded' , name ) ;
245257 currentScope . $eval ( onloadExp ) ;
246258 }
247259 } ;
0 commit comments