Skip to content

Sidenav - provide means to open/close from non-child elements #2591

Closed
@robwormald

Description

@robwormald

Bug, feature request, or proposal:

Given usage like:

<md-sidenav-container>
  <md-sidenav>
    <ul></ul>
  </md-sidenav>
  <my-component></my-component>
</md-sidenav-container>

Because my-component is not a child of the md-sidenav element, you can't inject MdSidenav into it, which makes programmatically toggling the Sidenav rather difficult (either you end up having to @ViewChild() query for it, and wiring that all up through your own service)

What is the expected behavior?

Developers should have an easy way to programmatically control the md-sidenav

What is the current behavior?

See above

Is there anything else we should know?

Material 1 provided a $sideNav service, which is the kind of thing i'm describing here: https://material.angularjs.org/latest/api/service/$mdSidenav

Metadata

Metadata

Assignees

Labels

P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentfeatureThis issue represents a new feature or feature request rather than a bug or bug fix

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions