-
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
fix: consistent names for all cdk directives #8088
Conversation
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
@@ -78,22 +77,21 @@ export const MAT_CONNECTED_OVERLAY_SCROLL_STRATEGY_PROVIDER = { | |||
selector: '[cdk-overlay-origin], [overlay-origin], [cdkOverlayOrigin]', | |||
exportAs: 'cdkOverlayOrigin', | |||
}) | |||
export class OverlayOrigin { | |||
export class CdkOverlayOrigin { |
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.
I was thinking about this one a few days ago: do we really need the directive? It doesn't really provide a lot of value since using it ends up being slightly longer than straight-up passing in the elementRef
to the overlay:
<button cdk-overlay-origin #origin="cdkOverlayOrigin">Open</button>
<ng-template cdk-connected-overlay [origin]="origin"></ng-template>
Versus something like this if we got rid of it:
<button #origin>Open</button>
<ng-template cdk-connected-overlay [origin]="origin"></ng-template>
It's not something we should necessarily address now, but it just something to think about.
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.
The problem is that if the element you're applying it do has a component (like mat-button
), you don't have a way to grab the ElementRef in the template.
4008a6d
to
8727672
Compare
Renames: `OverlayOrigin` -> `CdkOverlayOrigin` `ConnectedOverlayDirective` -> `CdkConnectedOverlay` `PortalDirective` -> `CdkPortal` `PortalHostDirective` -> `CdkPortalOutlet` `ObserveContent` -> `CdkObserveContent` Also stop using "mat" completely in the cdk. BREAKING CHANGE: `MAT_CONNECTED_OVERLAY_SCROLL_STRATEGY` is renamed to `CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY`
8727672
to
95a72c2
Compare
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. |
Based on #7544. Should be fully backwards compatible.
Renames:
OverlayOrigin
->CdkOverlayOrigin
ConnectedOverlayDirective
->CdkConnectedOverlay
PortalDirective
->CdkPortal
PortalHostDirective
->CdkPortalOutlet
ObserveContent
->CdkObserveContent
Also stop using "mat" completely in the cdk.
BREAKING CHANGE:
MAT_CONNECTED_OVERLAY_SCROLL_STRATEGY
is renamed toCDK_CONNECTED_OVERLAY_SCROLL_STRATEGY