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

Set menu position with binding #1329

Closed
ashleahhill opened this issue Sep 26, 2016 · 2 comments
Closed

Set menu position with binding #1329

ashleahhill opened this issue Sep 26, 2016 · 2 comments
Assignees
Labels
feature This issue represents a new feature or feature request rather than a bug or bug fix needs: discussion Further discussion with the team is needed before proceeding

Comments

@ashleahhill
Copy link

Bug, feature request, or proposal:

Feature Request

What is the -expected- desired behavior?

To be able to bind values to the x-position and y-position inputs of the md-menu.

What is the current behavior?

I can't set the x-position or y-position by binding to a value

Changing MyMenu's template to include this

<md-menu x-position="{{before}}" y-position="{{after}}" #menu="mdMenu">

Causes a template parse error, (because x-position and y-position are attributes, not inputs?).

Can't bind to 'y-position' since it isn't a known property of 'md-menu'.
1. If 'md-menu' is an Angular component and it has 'y-position' input, then verify that it is part of this module.
2. If 'md-menu' is a Web Component then add "CUSTOM_ELEMENTS_SCHEMA" to the '@NgModule.schema' of this component to suppress this message.

What are the steps to reproduce?

Can't get plunker to work with md-menu at the moment.

What is the use-case or motivation for changing an existing behavior?

For example, I want create a component that lets me drop in a menu with a list of items with custom behaviors already attached. Its template is basically this:

<button [md-menu-trigger-for]="menu">
Open Menu
</button>

<md-menu x-position="before" y-position="after" #menu="mdMenu">
    <button md-menu-item
      *ngFor="let item of menuItems"
      [item]="item"
      (action)="action(item)">
{{item.name}}
    </button>
</md-menu>

Sometimes, I am going to use these menus in a context where I have space on the left, or space on the right, or space above, ect. I want to be able to set in the x-position and y-position in the parent component and have it set on the menu.

<md-toolbar>
<span flex></span>
<my-menu [x-position]="before" [menu-items]="menuItemList">
</my-menu>
</md-toolbar>

Which versions of Angular, Material, OS, browsers are affected?

Angular 2.0.0
Material 8-2

Is there anything else we should know?

@kara kara added the feature This issue represents a new feature or feature request rather than a bug or bug fix label Feb 10, 2017
@crisbeto
Copy link
Member

Closing as a dupe of #4169 which will be resolved via #4213.

@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 5, 2019
@mmalerba mmalerba added the needs: discussion Further discussion with the team is needed before proceeding label Mar 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature This issue represents a new feature or feature request rather than a bug or bug fix needs: discussion Further discussion with the team is needed before proceeding
Projects
None yet
Development

No branches or pull requests

5 participants