Skip to content

Conversation

crisbeto
Copy link
Member

Adds a closeAll method that closes all of the currently-open dialogs.

@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Nov 22, 2016
if (index > -1) {
this._openDialogs.splice(index, 1);
}
});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would be a bit cleaner with another method:

dialogRef.afterClosed().subscribe(() => this._removeOpenDialog(dialogRef));


while (i--) {
this._openDialogs[i].close();
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this needs a comment like

// The `_openDialogs` property isn't updated after close until the rxjs subscription
// runs on the next microtask, so we loop through all of them and call close without
// assuming that they'll be removed from the list instantaneously. 

Adds a `closeAll` method that closes all of the currently-open dialogs.
@crisbeto
Copy link
Member Author

crisbeto commented Dec 1, 2016

Addressed the feedback and rebased.

@jelbourn
Copy link
Member

jelbourn commented Dec 1, 2016

LGTM

@jelbourn jelbourn added pr: lgtm action: merge The PR is ready for merge by the caretaker and removed pr: needs review labels Dec 1, 2016
@tinayuangao tinayuangao merged commit b2999c9 into angular:master Dec 2, 2016
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker cla: yes PR author has agreed to Google's Contributor License Agreement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants