Skip to content

Commit 214fe14

Browse files
docs(cdk/overlay): rename template variable from trigger to origin in example (#32821)
The #trigger template reference variable in the overlay basic example is misleading because it suggests the element triggers the overlay open/close behavior. In fact, it identifies the attachment point (origin) for the connected overlay. Rename it to #origin for clarity. Also fixes a typo in the comment ("it's" -> reworded). Closes #31221
1 parent c713b9b commit 214fe14

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/components-examples/cdk/overlay/cdk-overlay-basic/cdk-overlay-basic-example.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
<!-- This button triggers the overlay and is it's origin -->
2-
<button (click)="isOpen = !isOpen" type="button" cdkOverlayOrigin #trigger="cdkOverlayOrigin">
1+
<!-- This button is the origin to which the overlay is attached -->
2+
<button (click)="isOpen = !isOpen" type="button" cdkOverlayOrigin #origin="cdkOverlayOrigin">
33
{{isOpen ? "Close" : "Open"}}
44
</button>
55

66
<!-- This template displays the overlay content and is connected to the button -->
77
<ng-template
88
cdkConnectedOverlay
9-
[cdkConnectedOverlayOrigin]="trigger"
9+
[cdkConnectedOverlayOrigin]="origin"
1010
[cdkConnectedOverlayOpen]="isOpen"
1111
(detach)="isOpen = false"
1212
>

0 commit comments

Comments
 (0)