File tree Expand file tree Collapse file tree 2 files changed +32
-1
lines changed Expand file tree Collapse file tree 2 files changed +32
-1
lines changed Original file line number Diff line number Diff line change @@ -74,7 +74,7 @@ export class ComponentPortal<T> extends Portal<ComponentRef<T>> {
7474 /**
7575 * [Optional] Where the attached component should live in Angular's *logical* component tree.
7676 * This is different from where the component *renders*, which is determined by the PortalHost.
77- * The origin necessary when the host is outside of the Angular application context.
77+ * The origin is necessary when the host is outside of the Angular application context.
7878 */
7979 viewContainerRef : ViewContainerRef ;
8080
Original file line number Diff line number Diff line change @@ -46,3 +46,34 @@ You can control which elements are tab stops with the `tabindex` attribute
4646``` html
4747<button md-button tabindex =" -1" >Not Tabbable</button >
4848```
49+
50+ ### AOT Compilation
51+
52+ Due to the dynamic nature of the ` MdDialog ` , and its usage of ` ViewContainerRef#createComponent() `
53+ to create the component on the fly, the AOT compiler will not know to create the proper
54+ ` ComponentFactory ` for your dialog component by default.
55+
56+ You must include your dialog class in the list of ` entryComponents ` in your module definition so
57+ that the AOT compiler knows to create the ` ComponentFactory ` for it.
58+
59+ ``` ts
60+ @NgModule ({
61+ imports: [
62+ // ...
63+ MaterialModule
64+ ],
65+
66+ declarations: [
67+ AppComponent ,
68+ ExampleDialogComponent
69+ ],
70+
71+ entryComponents: [
72+ ExampleDialogComponent
73+ ]
74+
75+ providers : [],
76+ bootstrap: [AppComponent ]
77+ })
78+ export class AppModule () {}
79+ ```
You can’t perform that action at this time.
0 commit comments