@@ -34,8 +34,9 @@ import { ng1_directive } from './stateDirectives';
34
34
35
35
/** @hidden */
36
36
export type UIViewData = {
37
- $cfg : Ng1ViewConfig ;
38
- $uiView : ActiveUIView ;
37
+ $renderCommand : UIViewPortalRenderCommand ;
38
+ $cfg : Ng1ViewConfig ; // for backwards compat
39
+ $uiView : ActiveUIView ; // for backwards compat
39
40
} ;
40
41
41
42
/** @hidden */
@@ -301,6 +302,7 @@ uiView = [
301
302
animLeave = $q . defer ( ) ;
302
303
303
304
const $uiViewData : UIViewData = {
305
+ $renderCommand : renderCommand ,
304
306
$cfg : viewConfig ,
305
307
$uiView : activeUIView ,
306
308
} ;
@@ -384,17 +386,22 @@ function $ViewDirectiveFill(
384
386
tElement . empty ( ) ;
385
387
386
388
return function ( scope : IScope , $element : JQuery ) {
387
- const data : UIViewData = $element . data ( '$uiView' ) ;
388
- if ( ! data ) {
389
+ const data : UIViewData = $element . data ( '$uiView' ) || { } ;
390
+ const { $renderCommand, $uiView } = data ;
391
+ if ( ! $renderCommand || $renderCommand . command === 'RENDER_DEFAULT_CONTENT' ) {
389
392
$element . html ( initial ) ;
390
393
$compile ( $element . contents ( ) as any ) ( scope ) ;
391
394
return ;
395
+ } else if ( $renderCommand . command === 'RENDER_INTEROP_DIV' ) {
396
+ $element . html ( '<div></div>' ) ;
397
+ $renderCommand . giveDiv ( $element . find ( 'div' ) [ 0 ] ) ;
398
+ return ;
392
399
}
393
400
394
- const cfg : Ng1ViewConfig = data . $cfg || < any > { viewDecl : { } , getTemplate : noop } ;
401
+ const cfg : Ng1ViewConfig = $renderCommand . routedViewConfig || ( { viewDecl : { } , getTemplate : noop } as any ) ;
395
402
const resolveCtx : ResolveContext = cfg . path && new ResolveContext ( cfg . path ) ;
396
403
$element . html ( cfg . getTemplate ( $element , resolveCtx ) || initial ) ;
397
- trace . traceUIViewFill ( data . $uiView , $element . html ( ) ) ;
404
+ trace . traceUIViewFill ( $uiView , $element . html ( ) ) ;
398
405
399
406
const link = $compile ( $element . contents ( ) as any ) ;
400
407
const controller = cfg . controller as angular . IControllerService ;
0 commit comments