@@ -17,7 +17,7 @@ import {
1717 OnDestroy ,
1818 Input ,
1919} from '@angular/core' ;
20- import { Portal , TemplatePortal , ComponentPortal , BasePortalHost } from './portal' ;
20+ import { Portal , TemplatePortal , ComponentPortal , BasePortalOutlet } from './portal' ;
2121
2222
2323/**
@@ -36,18 +36,18 @@ export class TemplatePortalDirective extends TemplatePortal<any> {
3636
3737
3838/**
39- * Directive version of a PortalHost . Because the directive *is* a PortalHost , portals can be
39+ * Directive version of a PortalOutlet . Because the directive *is* a PortalOutlet , portals can be
4040 * directly attached to it, enabling declarative use.
4141 *
4242 * Usage:
43- * <ng-template [cdkPortalHost ]="greeting"></ng-template>
43+ * <ng-template [cdkPortalOutlet ]="greeting"></ng-template>
4444 */
4545@Directive ( {
46- selector : '[cdkPortalHost], [portalHost]' ,
47- exportAs : 'cdkPortalHost' ,
48- inputs : [ 'portal: cdkPortalHost ' ]
46+ selector : '[cdkPortalOutlet], [ cdkPortalHost], [portalHost]' ,
47+ exportAs : 'cdkPortalOutlet, cdkPortalHost' ,
48+ inputs : [ 'portal: cdkPortalOutlet ' ]
4949} )
50- export class PortalHostDirective extends BasePortalHost implements OnDestroy {
50+ export class PortalOutletDirective extends BasePortalOutlet implements OnDestroy {
5151 /** The attached portal. */
5252 private _portal : Portal < any > | null = null ;
5353
@@ -62,7 +62,12 @@ export class PortalHostDirective extends BasePortalHost implements OnDestroy {
6262 get _deprecatedPortal ( ) { return this . portal ; }
6363 set _deprecatedPortal ( v ) { this . portal = v ; }
6464
65- /** Portal associated with the Portal host. */
65+ /** @deprecated */
66+ @Input ( 'cdkPortalHost' )
67+ get _deprecatedPortalHost ( ) { return this . portal ; }
68+ set _deprecatedPortalHost ( v ) { this . portal = v ; }
69+
70+ /** Portal associated with the Portal outlet. */
6671 get portal ( ) : Portal < any > | null {
6772 return this . _portal ;
6873 }
@@ -85,16 +90,16 @@ export class PortalHostDirective extends BasePortalHost implements OnDestroy {
8590 }
8691
8792 /**
88- * Attach the given ComponentPortal to this PortalHost using the ComponentFactoryResolver.
93+ * Attach the given ComponentPortal to this PortalOutlet using the ComponentFactoryResolver.
8994 *
90- * @param portal Portal to be attached to the portal host .
95+ * @param portal Portal to be attached to the portal outlet .
9196 * @returns Reference to the created component.
9297 */
9398 attachComponentPortal < T > ( portal : ComponentPortal < T > ) : ComponentRef < T > {
9499 portal . setAttachedHost ( this ) ;
95100
96101 // If the portal specifies an origin, use that as the logical location of the component
97- // in the application tree. Otherwise use the location of this PortalHost .
102+ // in the application tree. Otherwise use the location of this PortalOutlet .
98103 let viewContainerRef = portal . viewContainerRef != null ?
99104 portal . viewContainerRef :
100105 this . _viewContainerRef ;
@@ -129,7 +134,7 @@ export class PortalHostDirective extends BasePortalHost implements OnDestroy {
129134
130135
131136@NgModule ( {
132- exports : [ TemplatePortalDirective , PortalHostDirective ] ,
133- declarations : [ TemplatePortalDirective , PortalHostDirective ] ,
137+ exports : [ TemplatePortalDirective , PortalOutletDirective ] ,
138+ declarations : [ TemplatePortalDirective , PortalOutletDirective ] ,
134139} )
135140export class PortalModule { }
0 commit comments