diff --git a/src/core/portal/README.md b/src/core/portal/README.md new file mode 100644 index 00000000000..dadd650f397 --- /dev/null +++ b/src/core/portal/README.md @@ -0,0 +1,72 @@ +# Portals + +### Overview + +A `Portal `is a piece of UI that can be dynamically rendered to an open slot on the page. + +The "piece of UI" can be either a `Component` or a `TemplateRef`. + +The "open slot" is a `PortalHost`. + +Portals and PortalHosts are low-level building blocks that other concepts, such as overlays, can +be built upon. + +##### `Portal` +| Method | Description | +| --- | --- | +| `attach(PortalHost): Promise` | Attaches the portal to a host. | +| `detach(): Promise` | Detaches the portal from its host. | +| `isAttached: boolean` | Whether the portal is attached. | + +##### `PortalHost` +| Method | Description | +| --- | --- | +| `attach(Portal): Promise` | Attaches a portal to the host. | +| `detach(): Promise` | Detaches the portal from the host. | +| `dispose(): Promise` | Permanently dispose the host. | +| `hasAttached: boolean` | Whether a portal is attached to the host. | + + + + +### Using portals + + + +##### `TemplatePortalDirective` +Used to get a portal from a `