File tree 2 files changed +32
-1
lines changed
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>> {
74
74
/**
75
75
* [Optional] Where the attached component should live in Angular's *logical* component tree.
76
76
* 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.
78
78
*/
79
79
viewContainerRef : ViewContainerRef ;
80
80
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
46
46
``` html
47
47
<button md-button tabindex =" -1" >Not Tabbable</button >
48
48
```
49
+
50
+ ### AOT Compilation
51
+
52
+ Due to the dynamic nature of the ` MdDialog ` , and it's 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 .forRoot ()
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