@@ -10,7 +10,6 @@ import {By} from '@angular/platform-browser';
1010import { NgModule , Component , Directive , ViewChild , ViewContainerRef } from '@angular/core' ;
1111import { MdDialog , MdDialogModule } from './dialog' ;
1212import { OverlayContainer } from '../core' ;
13- import { MdDialogConfig } from './dialog-config' ;
1413import { MdDialogRef } from './dialog-ref' ;
1514import { MdDialogContainer } from './dialog-container' ;
1615
@@ -48,10 +47,9 @@ describe('MdDialog', () => {
4847 } ) ;
4948
5049 it ( 'should open a dialog with a component' , ( ) => {
51- let config = new MdDialogConfig ( ) ;
52- config . viewContainerRef = testViewContainerRef ;
53-
54- let dialogRef = dialog . open ( PizzaMsg , config ) ;
50+ let dialogRef = dialog . open ( PizzaMsg , {
51+ viewContainerRef : testViewContainerRef
52+ } ) ;
5553
5654 viewContainerFixture . detectChanges ( ) ;
5755
@@ -79,11 +77,7 @@ describe('MdDialog', () => {
7977 } ) ;
8078
8179 it ( 'should apply the configured role to the dialog element' , ( ) => {
82- let config = new MdDialogConfig ( ) ;
83- config . viewContainerRef = testViewContainerRef ;
84- config . role = 'alertdialog' ;
85-
86- dialog . open ( PizzaMsg , config ) ;
80+ dialog . open ( PizzaMsg , { role : 'alertdialog' } ) ;
8781
8882 viewContainerFixture . detectChanges ( ) ;
8983
@@ -92,10 +86,9 @@ describe('MdDialog', () => {
9286 } ) ;
9387
9488 it ( 'should close a dialog and get back a result' , ( ) => {
95- let config = new MdDialogConfig ( ) ;
96- config . viewContainerRef = testViewContainerRef ;
97-
98- let dialogRef = dialog . open ( PizzaMsg , config ) ;
89+ let dialogRef = dialog . open ( PizzaMsg , {
90+ viewContainerRef : testViewContainerRef
91+ } ) ;
9992
10093 viewContainerFixture . detectChanges ( ) ;
10194
@@ -112,10 +105,9 @@ describe('MdDialog', () => {
112105
113106
114107 it ( 'should close a dialog via the escape key' , ( ) => {
115- let config = new MdDialogConfig ( ) ;
116- config . viewContainerRef = testViewContainerRef ;
117-
118- dialog . open ( PizzaMsg , config ) ;
108+ dialog . open ( PizzaMsg , {
109+ viewContainerRef : testViewContainerRef
110+ } ) ;
119111
120112 viewContainerFixture . detectChanges ( ) ;
121113
@@ -129,10 +121,9 @@ describe('MdDialog', () => {
129121 } ) ;
130122
131123 it ( 'should close when clicking on the overlay backdrop' , ( ) => {
132- let config = new MdDialogConfig ( ) ;
133- config . viewContainerRef = testViewContainerRef ;
134-
135- dialog . open ( PizzaMsg , config ) ;
124+ dialog . open ( PizzaMsg , {
125+ viewContainerRef : testViewContainerRef
126+ } ) ;
136127
137128 viewContainerFixture . detectChanges ( ) ;
138129
@@ -144,11 +135,10 @@ describe('MdDialog', () => {
144135
145136 describe ( 'disableClose option' , ( ) => {
146137 it ( 'should prevent closing via clicks on the backdrop' , ( ) => {
147- let config = new MdDialogConfig ( ) ;
148- config . viewContainerRef = testViewContainerRef ;
149- config . disableClose = true ;
150-
151- dialog . open ( PizzaMsg , config ) ;
138+ dialog . open ( PizzaMsg , {
139+ disableClose : true ,
140+ viewContainerRef : testViewContainerRef
141+ } ) ;
152142
153143 viewContainerFixture . detectChanges ( ) ;
154144
@@ -159,11 +149,10 @@ describe('MdDialog', () => {
159149 } ) ;
160150
161151 it ( 'should prevent closing via the escape key' , ( ) => {
162- let config = new MdDialogConfig ( ) ;
163- config . viewContainerRef = testViewContainerRef ;
164- config . disableClose = true ;
165-
166- dialog . open ( PizzaMsg , config ) ;
152+ dialog . open ( PizzaMsg , {
153+ disableClose : true ,
154+ viewContainerRef : testViewContainerRef
155+ } ) ;
167156
168157 viewContainerFixture . detectChanges ( ) ;
169158
@@ -189,10 +178,10 @@ describe('MdDialog', () => {
189178 } ) ;
190179
191180 it ( 'should focus the first tabbable element of the dialog on open' , fakeAsync ( ( ) => {
192- let config = new MdDialogConfig ( ) ;
193- config . viewContainerRef = testViewContainerRef ;
181+ dialog . open ( PizzaMsg , {
182+ viewContainerRef : testViewContainerRef
183+ } ) ;
194184
195- dialog . open ( PizzaMsg , config ) ;
196185 viewContainerFixture . detectChanges ( ) ;
197186 flushMicrotasks ( ) ;
198187
@@ -207,10 +196,10 @@ describe('MdDialog', () => {
207196 document . body . appendChild ( button ) ;
208197 button . focus ( ) ;
209198
210- let config = new MdDialogConfig ( ) ;
211- config . viewContainerRef = testViewContainerRef ;
199+ let dialogRef = dialog . open ( PizzaMsg , {
200+ viewContainerRef : testViewContainerRef
201+ } ) ;
212202
213- let dialogRef = dialog . open ( PizzaMsg , config ) ;
214203 viewContainerFixture . detectChanges ( ) ;
215204 flushMicrotasks ( ) ;
216205
0 commit comments