diff --git a/src/lib/core/portal/portal.ts b/src/lib/core/portal/portal.ts index 2e06379e6e17..8a083395cc18 100644 --- a/src/lib/core/portal/portal.ts +++ b/src/lib/core/portal/portal.ts @@ -74,7 +74,7 @@ export class ComponentPortal extends Portal> { /** * [Optional] Where the attached component should live in Angular's *logical* component tree. * This is different from where the component *renders*, which is determined by the PortalHost. - * The origin necessary when the host is outside of the Angular application context. + * The origin is necessary when the host is outside of the Angular application context. */ viewContainerRef: ViewContainerRef; diff --git a/src/lib/dialog/dialog.md b/src/lib/dialog/dialog.md index 4bf40be69e99..3b858bf38e39 100644 --- a/src/lib/dialog/dialog.md +++ b/src/lib/dialog/dialog.md @@ -46,3 +46,34 @@ You can control which elements are tab stops with the `tabindex` attribute ```html ``` + +### AOT Compilation + +Due to the dynamic nature of the `MdDialog`, and its usage of `ViewContainerRef#createComponent()` +to create the component on the fly, the AOT compiler will not know to create the proper +`ComponentFactory` for your dialog component by default. + +You must include your dialog class in the list of `entryComponents` in your module definition so +that the AOT compiler knows to create the `ComponentFactory` for it. + +```ts +@NgModule({ + imports: [ + // ... + MaterialModule + ], + + declarations: [ + AppComponent, + ExampleDialogComponent + ], + + entryComponents: [ + ExampleDialogComponent + ] + + providers: [], + bootstrap: [AppComponent] +}) +export class AppModule() {} +``` \ No newline at end of file