-
Notifications
You must be signed in to change notification settings - Fork 6.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(sidenav): open all sidenavs from MdSidenavContainer #2870
feat(sidenav): open all sidenavs from MdSidenavContainer #2870
Conversation
src/lib/sidenav/sidenav.ts
Outdated
} | ||
|
||
return Promise.all(promises); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unit test?
src/lib/sidenav/sidenav.ts
Outdated
@@ -367,6 +367,36 @@ export class MdSidenavContainer implements AfterContentInit { | |||
this._validateDrawers(); | |||
} | |||
|
|||
/** Calls `open` of both start and end sidenavs */ | |||
public open() { | |||
const promises: Promise<MdSidenavToggleResult>[] = []; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can't this be simplified to:
return Promise.all([this._start, this._end].map((sidenav) => sidenav && sidenav.open()));
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks that's much simpler
4cdb828
to
a4071e9
Compare
a4071e9
to
1d6449b
Compare
- added `open` and `close` functions that applies to both sidenavs in the container and resolves when both are finished fixes angular#2591
1d6449b
to
b4fdcc8
Compare
@mmalerba is this merge-ready? |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
open
andclose
functions that applies to both sidenavs in the container and resolves when both are finishedfixes #2591