File tree Expand file tree Collapse file tree 4 files changed +38
-0
lines changed Expand file tree Collapse file tree 4 files changed +38
-0
lines changed Original file line number Diff line number Diff line change @@ -68,6 +68,8 @@ The position can be changed using the `xPosition` (`before | after`) and `yPosit
68
68
</button >
69
69
```
70
70
71
+ <!-- example(menu-position) -->
72
+
71
73
### Nested menu
72
74
73
75
Material supports the ability for an ` mat-menu-item ` to open a sub-menu. To do so, you have to define
Original file line number Diff line number Diff line change
1
+ /** No CSS for this example */
Original file line number Diff line number Diff line change
1
+ < button mat-button [matMenuTriggerFor] ="aboveMenu "> Above</ button >
2
+ < mat-menu #aboveMenu ="matMenu " yPosition ="above ">
3
+ < button mat-menu-item > Item 1</ button >
4
+ < button mat-menu-item > Item 2</ button >
5
+ </ mat-menu >
6
+
7
+ < button mat-button [matMenuTriggerFor] ="belowMenu "> Below</ button >
8
+ < mat-menu #belowMenu ="matMenu " yPosition ="below ">
9
+ < button mat-menu-item > Item 1</ button >
10
+ < button mat-menu-item > Item 2</ button >
11
+ </ mat-menu >
12
+
13
+ < button mat-button [matMenuTriggerFor] ="beforeMenu "> Before</ button >
14
+ < mat-menu #beforeMenu ="matMenu " xPosition ="before ">
15
+ < button mat-menu-item > Item 1</ button >
16
+ < button mat-menu-item > Item 2</ button >
17
+ </ mat-menu >
18
+
19
+
20
+ < button mat-button [matMenuTriggerFor] ="afterMenu "> After</ button >
21
+ < mat-menu #afterMenu ="matMenu " xPosition ="after ">
22
+ < button mat-menu-item > Item 1</ button >
23
+ < button mat-menu-item > Item 2</ button >
24
+ </ mat-menu >
Original file line number Diff line number Diff line change
1
+ import { Component } from '@angular/core' ;
2
+
3
+ /**
4
+ * @title Menu positioning
5
+ */
6
+ @Component ( {
7
+ selector : 'menu-position-example' ,
8
+ templateUrl : 'menu-position-example.html' ,
9
+ styleUrls : [ 'menu-position-example.css' ] ,
10
+ } )
11
+ export class MenuPositionExample { }
You can’t perform that action at this time.
0 commit comments