@@ -180,9 +180,6 @@ function $ViewDirective( $state, $injector, $uiViewScroll, $interpolate)
180
180
scope . $on ( '$stateChangeSuccess' , function ( ) {
181
181
updateView ( false ) ;
182
182
} ) ;
183
- scope . $on ( '$viewContentLoading' , function ( ) {
184
- updateView ( false ) ;
185
- } ) ;
186
183
187
184
updateView ( true ) ;
188
185
@@ -216,6 +213,20 @@ function $ViewDirective( $state, $injector, $uiViewScroll, $interpolate)
216
213
newScope = scope . $new ( ) ;
217
214
latestLocals = $state . $current . locals [ name ] ;
218
215
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
+
219
230
var clone = $transclude ( newScope , function ( clone ) {
220
231
renderer . enter ( clone , $element , function onUiViewEnter ( ) {
221
232
if ( currentScope ) {
@@ -236,12 +247,13 @@ function $ViewDirective( $state, $injector, $uiViewScroll, $interpolate)
236
247
* @name ui.router.state.directive:ui-view#$viewContentLoaded
237
248
* @eventOf ui.router.state.directive:ui-view
238
249
* @eventType emits on ui-view directive scope
239
- * @description *
250
+ * @description
240
251
* Fired once the view is **loaded**, *after* the DOM is rendered.
241
252
*
242
253
* @param {Object } event Event object.
254
+ * @param {string } viewName Name of the view.
243
255
*/
244
- currentScope . $emit ( '$viewContentLoaded' ) ;
256
+ currentScope . $emit ( '$viewContentLoaded' , name ) ;
245
257
currentScope . $eval ( onloadExp ) ;
246
258
}
247
259
} ;
0 commit comments