@@ -226,7 +226,7 @@ uiView = [
226226 inherited = $element . inheritedData ( '$uiView' ) || rootData ,
227227 name = $interpolate ( attrs [ 'uiView' ] || attrs [ 'name' ] || '' ) ( scope ) || '$default' ;
228228
229- let previousEl : JQuery , currentEl : JQuery , currentScope : IScope , viewConfig : Ng1ViewConfig ;
229+ let previousEl : JQuery , currentEl : JQuery , currentScope : IScope ;
230230
231231 const uiViewId = $view . registerView ( 'ng1' , inherited . $uiView . id , name , renderContentIntoUIViewPortal ) ;
232232
@@ -256,20 +256,9 @@ uiView = [
256256
257257 trace . traceUIViewEvent ( 'Linking' , activeUIView ) ;
258258
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-
270259 $element . data ( '$uiView' , { $uiView : activeUIView } ) ;
271260
272- updateView ( ) ;
261+ renderContentIntoUIViewPortal ( { command : 'RENDER_DEFAULT_CONTENT' } ) ;
273262
274263 function cleanupLastView ( ) {
275264 if ( previousEl ) {
@@ -297,13 +286,18 @@ uiView = [
297286 }
298287 }
299288
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+
301295 const newScope = scope . $new ( ) ;
302296 const animEnter = $q . defer ( ) ,
303297 animLeave = $q . defer ( ) ;
304298
305299 const $uiViewData : UIViewData = {
306- $cfg : config ,
300+ $cfg : viewConfig ,
307301 $uiView : activeUIView ,
308302 } ;
309303
@@ -354,7 +348,7 @@ uiView = [
354348 *
355349 * @param {Object } event Event object.
356350 */
357- currentScope . $emit ( '$viewContentLoaded' , config || viewConfig ) ;
351+ currentScope . $emit ( '$viewContentLoaded' , viewConfig ) ;
358352 currentScope . $eval ( onloadExp ) ;
359353 }
360354 } ;
0 commit comments