@@ -226,7 +226,7 @@ uiView = [
226
226
inherited = $element . inheritedData ( '$uiView' ) || rootData ,
227
227
name = $interpolate ( attrs [ 'uiView' ] || attrs [ 'name' ] || '' ) ( scope ) || '$default' ;
228
228
229
- let previousEl : JQuery , currentEl : JQuery , currentScope : IScope , viewConfig : Ng1ViewConfig ;
229
+ let previousEl : JQuery , currentEl : JQuery , currentScope : IScope ;
230
230
231
231
const uiViewId = $view . registerView ( 'ng1' , inherited . $uiView . id , name , renderContentIntoUIViewPortal ) ;
232
232
@@ -256,20 +256,9 @@ uiView = [
256
256
257
257
trace . traceUIViewEvent ( 'Linking' , activeUIView ) ;
258
258
259
- function renderContentIntoUIViewPortal ( renderCommand : UIViewPortalRenderCommand ) {
260
- if ( renderCommand . command === 'RENDER_DEFAULT_CONTENT' ) {
261
- viewConfig = undefined ;
262
- } else if ( renderCommand . command === 'RENDER_ROUTED_VIEW' ) {
263
- viewConfig = renderCommand . routedViewConfig as Ng1ViewConfig ;
264
- } else if ( renderCommand . command === 'RENDER_INTEROP_DIV' ) {
265
- }
266
-
267
- updateView ( viewConfig ) ;
268
- }
269
-
270
259
$element . data ( '$uiView' , { $uiView : activeUIView } ) ;
271
260
272
- updateView ( ) ;
261
+ renderContentIntoUIViewPortal ( { command : 'RENDER_DEFAULT_CONTENT' } ) ;
273
262
274
263
function cleanupLastView ( ) {
275
264
if ( previousEl ) {
@@ -297,13 +286,18 @@ uiView = [
297
286
}
298
287
}
299
288
300
- function updateView ( config ?: Ng1ViewConfig ) {
289
+ function renderContentIntoUIViewPortal ( renderCommand : UIViewPortalRenderCommand ) {
290
+ const viewConfig =
291
+ renderCommand . command === 'RENDER_ROUTED_VIEW'
292
+ ? ( renderCommand . routedViewConfig as Ng1ViewConfig )
293
+ : undefined ;
294
+
301
295
const newScope = scope . $new ( ) ;
302
296
const animEnter = $q . defer ( ) ,
303
297
animLeave = $q . defer ( ) ;
304
298
305
299
const $uiViewData : UIViewData = {
306
- $cfg : config ,
300
+ $cfg : viewConfig ,
307
301
$uiView : activeUIView ,
308
302
} ;
309
303
@@ -354,7 +348,7 @@ uiView = [
354
348
*
355
349
* @param {Object } event Event object.
356
350
*/
357
- currentScope . $emit ( '$viewContentLoaded' , config || viewConfig ) ;
351
+ currentScope . $emit ( '$viewContentLoaded' , viewConfig ) ;
358
352
currentScope . $eval ( onloadExp ) ;
359
353
}
360
354
} ;
0 commit comments