@@ -75,7 +75,7 @@ export class MdcDialog implements OnDestroy {
7575 * @param config Extra configuration options.
7676 * @returns Reference to the newly-opened dialog.
7777 */
78- open < T , D = any , R = { } > ( componentOrTemplateRef : ComponentType < T > | TemplateRef < T > ,
78+ open < T , D = any , R = any > ( componentOrTemplateRef : ComponentType < T > | TemplateRef < T > ,
7979 config ?: MdcDialogConfig < D > ) : MdcDialogRef < T , R > {
8080
8181 config = _applyConfigDefaults ( config , this . _defaultOptions || new MdcDialogConfig ( ) ) ;
@@ -86,7 +86,7 @@ export class MdcDialog implements OnDestroy {
8686
8787 const overlayRef = this . _createOverlay ( ) ;
8888 const dialogContainer = this . _attachDialogContainer ( overlayRef , config ) ;
89- const dialogRef = this . _attachDialogContent < T > ( componentOrTemplateRef ,
89+ const dialogRef = this . _attachDialogContent < T , R > ( componentOrTemplateRef ,
9090 dialogContainer ,
9191 overlayRef ,
9292 config ) ;
@@ -154,15 +154,15 @@ export class MdcDialog implements OnDestroy {
154154 * @param config The dialog configuration.
155155 * @returns A promise resolving to the MdcDialogRef that should be returned to the user.
156156 */
157- private _attachDialogContent < T > (
157+ private _attachDialogContent < T , R > (
158158 componentOrTemplateRef : ComponentType < T > | TemplateRef < T > ,
159159 dialogContainer : MdcDialogPortal ,
160160 overlayRef : OverlayRef ,
161- config : MdcDialogConfig ) : MdcDialogRef < T > {
161+ config : MdcDialogConfig ) : MdcDialogRef < T , R > {
162162
163163 // Create a reference to the dialog we're creating in order to give the user a handle
164164 // to modify and close it.
165- const dialogRef = new MdcDialogRef < T > ( overlayRef , dialogContainer , config . id ) ;
165+ const dialogRef = new MdcDialogRef < T , R > ( overlayRef , dialogContainer , config . id ) ;
166166
167167 if ( componentOrTemplateRef instanceof TemplateRef ) {
168168 dialogContainer . attachTemplatePortal (
@@ -171,7 +171,7 @@ export class MdcDialog implements OnDestroy {
171171 } else {
172172 const injector = this . _createInjector < T > ( config , dialogRef , dialogContainer ) ;
173173 const contentRef = dialogContainer . attachComponentPortal < T > (
174- new ComponentPortal ( componentOrTemplateRef , undefined , injector ) ) ;
174+ new ComponentPortal ( componentOrTemplateRef , config . viewContainerRef , injector ) ) ;
175175 dialogRef . componentInstance = contentRef . instance ;
176176 }
177177
0 commit comments