File tree 2 files changed +10
-5
lines changed
2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change 1
- import { Component , Inject } from '@angular/core' ;
2
- import { DOCUMENT } from '@angular/platform-browser' ;
1
+ import { Component , Inject } from '@angular/core' ;
2
+ import { DOCUMENT } from '@angular/platform-browser' ;
3
3
import { MdDialog , MdDialogRef , MdDialogConfig } from '@angular/material' ;
4
4
5
5
@Component ( {
Original file line number Diff line number Diff line change @@ -22,17 +22,22 @@ import {MdDialogContainer} from './dialog-container';
22
22
@Injectable ( )
23
23
export class MdDialog {
24
24
private _openDialogsAtThisLevel : MdDialogRef < any > [ ] = [ ] ;
25
+ private _afterAllClosedAtThisLevel = new Subject < void > ( ) ;
26
+ private _afterOpenAtThisLevel = new Subject < MdDialogRef < any > > ( ) ;
25
27
26
28
/** Keeps track of the currently-open dialogs. */
27
29
get _openDialogs ( ) : MdDialogRef < any > [ ] {
28
30
return this . _parentDialog ? this . _parentDialog . _openDialogs : this . _openDialogsAtThisLevel ;
29
31
}
30
32
31
33
/** Subject for notifying the user that all open dialogs have finished closing. */
32
- private _afterAllClosed = new Subject < void > ( ) ;
33
-
34
+ get _afterOpen ( ) : Subject < MdDialogRef < any > > {
35
+ return this . _parentDialog ? this . _parentDialog . _afterOpen : this . _afterOpenAtThisLevel ;
36
+ }
34
37
/** Subject for notifying the user that a dialog has opened. */
35
- private _afterOpen = new Subject < MdDialogRef < any > > ( ) ;
38
+ get _afterAllClosed ( ) : Subject < void > {
39
+ return this . _parentDialog ? this . _parentDialog . _afterAllClosed : this . _afterAllClosedAtThisLevel ;
40
+ }
36
41
37
42
/** Gets an observable that is notified when a dialog has been opened. */
38
43
afterOpen : Observable < MdDialogRef < any > > = this . _afterOpen . asObservable ( ) ;
You can’t perform that action at this time.
0 commit comments