@@ -10,7 +10,6 @@ import {By} from '@angular/platform-browser';
10
10
import { NgModule , Component , Directive , ViewChild , ViewContainerRef } from '@angular/core' ;
11
11
import { MdDialog , MdDialogModule } from './dialog' ;
12
12
import { OverlayContainer } from '../core' ;
13
- import { MdDialogConfig } from './dialog-config' ;
14
13
import { MdDialogRef } from './dialog-ref' ;
15
14
import { MdDialogContainer } from './dialog-container' ;
16
15
@@ -48,10 +47,9 @@ describe('MdDialog', () => {
48
47
} ) ;
49
48
50
49
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
+ } ) ;
55
53
56
54
viewContainerFixture . detectChanges ( ) ;
57
55
@@ -79,11 +77,7 @@ describe('MdDialog', () => {
79
77
} ) ;
80
78
81
79
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' } ) ;
87
81
88
82
viewContainerFixture . detectChanges ( ) ;
89
83
@@ -92,10 +86,9 @@ describe('MdDialog', () => {
92
86
} ) ;
93
87
94
88
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
+ } ) ;
99
92
100
93
viewContainerFixture . detectChanges ( ) ;
101
94
@@ -112,10 +105,9 @@ describe('MdDialog', () => {
112
105
113
106
114
107
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
+ } ) ;
119
111
120
112
viewContainerFixture . detectChanges ( ) ;
121
113
@@ -129,10 +121,9 @@ describe('MdDialog', () => {
129
121
} ) ;
130
122
131
123
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
+ } ) ;
136
127
137
128
viewContainerFixture . detectChanges ( ) ;
138
129
@@ -144,11 +135,10 @@ describe('MdDialog', () => {
144
135
145
136
describe ( 'disableClose option' , ( ) => {
146
137
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
+ } ) ;
152
142
153
143
viewContainerFixture . detectChanges ( ) ;
154
144
@@ -159,11 +149,10 @@ describe('MdDialog', () => {
159
149
} ) ;
160
150
161
151
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
+ } ) ;
167
156
168
157
viewContainerFixture . detectChanges ( ) ;
169
158
@@ -189,10 +178,10 @@ describe('MdDialog', () => {
189
178
} ) ;
190
179
191
180
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
+ } ) ;
194
184
195
- dialog . open ( PizzaMsg , config ) ;
196
185
viewContainerFixture . detectChanges ( ) ;
197
186
flushMicrotasks ( ) ;
198
187
@@ -207,10 +196,10 @@ describe('MdDialog', () => {
207
196
document . body . appendChild ( button ) ;
208
197
button . focus ( ) ;
209
198
210
- let config = new MdDialogConfig ( ) ;
211
- config . viewContainerRef = testViewContainerRef ;
199
+ let dialogRef = dialog . open ( PizzaMsg , {
200
+ viewContainerRef : testViewContainerRef
201
+ } ) ;
212
202
213
- let dialogRef = dialog . open ( PizzaMsg , config ) ;
214
203
viewContainerFixture . detectChanges ( ) ;
215
204
flushMicrotasks ( ) ;
216
205
0 commit comments