-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
Allow menu-trigger to take a menu interface. #1564
Conversation
I went back and forth on whether or not to make it an abstract class with many of the implementation details on the abstract class. I went with the interface because it's less invasive to the consumer than an abstract class. |
3ac4f64
to
68e8c55
Compare
Force pushed to address the conflict in merge of #1534. |
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.
It would be good to also have a unit test that binds a dummy impl of MdMenuPanel
and assert that a basic action works.
templateRef: TemplateRef<any>; | ||
close: EventEmitter<void>; | ||
_focusFirstItem: () => void; | ||
_setClickCatcher: (bool: boolean) => void; |
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.
If these two are going to be part of this interface, they'll should lose the underscore (which implies "internal api only")
import {EventEmitter, TemplateRef} from '@angular/core'; | ||
import {MenuPositionX, MenuPositionY} from './menu-positions'; | ||
|
||
export interface MdMenuInterface { |
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.
Let's call this MdMenuPanel
(generally trying to avoid using the word "interface" in the names of interfaces)
Hey @jelbourn, I have made the requested updates. Good suggestions. The test really helps demonstrate the creation of custom menus. |
LGTM aside from a couple last comments. @kara should also take a look |
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.
LGTM, aside from the one comment. Looks like this needs to be rebased as well
positionY: MenuPositionY; | ||
templateRef: TemplateRef<any>; | ||
close: EventEmitter<void>; | ||
_focusFirstItem: () => void; |
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.
Agree with @jelbourn that underscore should be removed if possible
This should enable menus to be more easily extended for custom menu implementations.
941ef87
to
2a5529a
Compare
Hey @kara, thanks for the review. I have removed the underscore from the interface, rebased, squashed my commits, and updated the commit message style. |
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.
LGTM
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. |
This should enable menus to be more easily extended for custom menu implementations.
Addresses #1560.