We can also include menus inside another menu as much as we want.
To begin, add the MatMenuModule to the project. Go to the app component TypeScript file, add the import statement, and add it to the app.
Creating the Menu
To create the menu, use the mat-menu element Go into a HTML file and add it to the page.
Then to the add menu items, add a button element for each item and then apply the mat-menu-item property to each button.
Lastly, give the menu a template reference.
Positioning the Menu
To place the menu above the element, apply the yPosition attribute to the menu and set it to above.
Lastly, to place the menu at the end of the element, we use xPosition and set it to before.
©2019 - 2024 Codeible. All rights reserved.