@@ -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
@@ -65,11 +63,10 @@ describe('MdDialog', () => {
65
63
} ) ;
66
64
67
65
it ( 'should apply the configured role to the dialog element' , ( ) => {
68
- let config = new MdDialogConfig ( ) ;
69
- config . viewContainerRef = testViewContainerRef ;
70
- config . role = 'alertdialog' ;
71
-
72
- dialog . open ( PizzaMsg , config ) ;
66
+ dialog . open ( PizzaMsg , {
67
+ viewContainerRef : testViewContainerRef ,
68
+ role : 'alertdialog'
69
+ } ) ;
73
70
74
71
viewContainerFixture . detectChanges ( ) ;
75
72
@@ -78,10 +75,9 @@ describe('MdDialog', () => {
78
75
} ) ;
79
76
80
77
it ( 'should close a dialog and get back a result' , ( ) => {
81
- let config = new MdDialogConfig ( ) ;
82
- config . viewContainerRef = testViewContainerRef ;
83
-
84
- let dialogRef = dialog . open ( PizzaMsg , config ) ;
78
+ let dialogRef = dialog . open ( PizzaMsg , {
79
+ viewContainerRef : testViewContainerRef
80
+ } ) ;
85
81
86
82
viewContainerFixture . detectChanges ( ) ;
87
83
@@ -98,10 +94,9 @@ describe('MdDialog', () => {
98
94
99
95
100
96
it ( 'should close a dialog via the escape key' , ( ) => {
101
- let config = new MdDialogConfig ( ) ;
102
- config . viewContainerRef = testViewContainerRef ;
103
-
104
- dialog . open ( PizzaMsg , config ) ;
97
+ dialog . open ( PizzaMsg , {
98
+ viewContainerRef : testViewContainerRef
99
+ } ) ;
105
100
106
101
viewContainerFixture . detectChanges ( ) ;
107
102
@@ -115,10 +110,9 @@ describe('MdDialog', () => {
115
110
} ) ;
116
111
117
112
it ( 'should close when clicking on the overlay backdrop' , ( ) => {
118
- let config = new MdDialogConfig ( ) ;
119
- config . viewContainerRef = testViewContainerRef ;
120
-
121
- dialog . open ( PizzaMsg , config ) ;
113
+ dialog . open ( PizzaMsg , {
114
+ viewContainerRef : testViewContainerRef
115
+ } ) ;
122
116
123
117
viewContainerFixture . detectChanges ( ) ;
124
118
@@ -140,10 +134,10 @@ describe('MdDialog', () => {
140
134
} ) ;
141
135
142
136
it ( 'should focus the first tabbable element of the dialog on open' , fakeAsync ( ( ) => {
143
- let config = new MdDialogConfig ( ) ;
144
- config . viewContainerRef = testViewContainerRef ;
137
+ dialog . open ( PizzaMsg , {
138
+ viewContainerRef : testViewContainerRef
139
+ } ) ;
145
140
146
- dialog . open ( PizzaMsg , config ) ;
147
141
viewContainerFixture . detectChanges ( ) ;
148
142
flushMicrotasks ( ) ;
149
143
@@ -158,10 +152,10 @@ describe('MdDialog', () => {
158
152
document . body . appendChild ( button ) ;
159
153
button . focus ( ) ;
160
154
161
- let config = new MdDialogConfig ( ) ;
162
- config . viewContainerRef = testViewContainerRef ;
155
+ let dialogRef = dialog . open ( PizzaMsg , {
156
+ viewContainerRef : testViewContainerRef
157
+ } ) ;
163
158
164
- let dialogRef = dialog . open ( PizzaMsg , config ) ;
165
159
viewContainerFixture . detectChanges ( ) ;
166
160
flushMicrotasks ( ) ;
167
161
0 commit comments