Skip to content
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

Sidebar: toggle via observable @Input() #17639

Closed
alastair-todd opened this issue Nov 7, 2019 · 2 comments
Labels

Comments

@alastair-todd
Copy link

@alastair-todd alastair-todd commented Nov 7, 2019

Feature Description

Add a toggleTrigger: Observable<boolean> @Input to the Sidebar component

Use Case

I use a state-based UI architecture, and I want to bind an observable boolean directly to the sidenav so that I don't have to manage the open() and close() methods myself.

<mat-drawer toggleTrigger="burgerBarVisible$"></mat-drawer>

@alastair-todd alastair-todd changed the title Sidebar: toggle via observable @Input() Feature: Sidebar: toggle via observable @Input() Nov 7, 2019
@alastair-todd alastair-todd changed the title Feature: Sidebar: toggle via observable @Input() Sidebar: toggle via observable @Input() Nov 7, 2019
@MRMokwa

This comment has been minimized.

Copy link

@MRMokwa MRMokwa commented Nov 7, 2019

Try this:
<mat-drawer [opened]="burgerBarVisible$ | async">

@jelbourn

This comment has been minimized.

Copy link
Member

@jelbourn jelbourn commented Nov 7, 2019

Yep, the async pipe is the preferred approach for this.

@jelbourn jelbourn closed this Nov 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.