Creating a vertical navigation panel with md-menu and material icons

Struggling to implement the md-menu to create a vertical menu using material icons.

Unfortunately, I am only able to create a horizontal menu and the icons are misaligned, failing to work when placed within

<md-icon md-svg-icon="hotel" md-menu-align-target></md-icon>

Here is the code snippet:

<md-menu md-position-mode="target-right target" class="">

    <md-button aria-label="" class="md-icon-button" ng-click="$mdMenu.open()">
        <img src="../img/Menu.png" alt="Menu">
    </md-button>

    <md-menu-content width="2">
    <md-menu-item>
        <md-button ui-sref="book"> <span md-menu-align-target><i class="material-icons">hotel</i> New Booking</span></md-button>
        <md-button ui-sref="book"> <span md-menu-align-target><i class="material-icons">hotel</i> New Booking</span></md-button>
        <md-menu-divider></md-menu-divider>
        <md-button ui-sref="book"> <span md-menu-align-target><i class="material-icons">hotel</i> New Booking</span></md-button>
        <md-button ui-sref="book"> <span md-menu-align-target><i class="material-icons">hotel</i> New Booking</span></md-button>
    </md-menu-item>
    </md-menu-content>

</md-menu>

Above shows my desired output while below depicts the current situation:

https://i.sstatic.net/qjcDC.jpg

FIRST PROBLEM Need to transform the menu into a vertical layout positioned beneath the arrow button.

SECOND PROBLEM Struggling to display icons similar to those in the angular examples that I have experimented with.

Attempted creating buttons like this:

<md-button ui-sref="book">
    <md-icon md-svg-icon="hotel" md-menu-align-target></md-icon>
    Booking
</md-button>

But unfortunately, the icons fail to appear.

Answer №1

It appears that the correct HTML structure is not being utilized for md-menu-item. Each menu item should be contained within its own md-menu-item element, like so:

<md-menu-item>
    <md-button ui-sref="book"> <span md-menu-align-target><i class="material-icons">hotel</i> New Booking</span></md-button>
</md-menu-item>
<md-menu-item>
    <md-button ui-sref="book"> <span md-menu-align-target><i class="material-icons">hotel</i> New Booking</span></md-button>
</md-menu-item>
    ...

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

React Div Element Not Extending to Web Page Margin

creating white space between the green div and both the top and sides of the screen This is my index page export default function Home() { return( <div className = {stylesMain.bodyDiv}> <div>home</div> &l ...

Is there a way to arrange an HTML list in this specific manner using CSS or JavaScript?

I need to arrange a list of items in columns with 5 rows each, as shown in the attached image. This list is generated dynamically using an SQL query with a loop on the li tag. I am looking for a solution to order the list in this way using javascript or ...

Attempting to apply styles to an unordered list within a division using CSS, without the ability to define a class

<div class="facetwp-selections"> <ul> <li data-facet="countries">USA</li> <li data-facet="countries">UK</li> <li data-facet="countries">Germany</li> < ...

What is the process for aligning a Component to the right within the Navbar in an AppLayout

In my project, the MainView class is an extension of an AppLayout. I am attempting to populate the Navbar with a logo on the left and the user ID on the right. Despite my efforts, both components keep aligning to the left side. Desired Navbar layout: ...

After submitting the form, the delete button in Bootstrap 4 has transformed into an unusual shape

I have a panel on my page, inside the panel header there is a red delete button. The panel content includes a form with several buttons (the red delete button is not inside the form, but linked to it with the form="abc" attribute). In the image below, whe ...

Launching Java Elements within HTML documents

Is it possible to create or initialize a Java variable within HTML? I have come across instances of Java being used in HTML, such as this: <object classid="javax.swing.JButton" label="I'm a button!"></object> This cod ...

The test is failing to execute the service mock promise due to an issue with the `

A problem has arisen while creating a mock for the BoardService. It appears that the .then function is not executing in the controller during testing, even though it works perfectly fine in the live application. Below is the test snippet: beforeEach(inje ...

Organizing Data in Angular

I've been working on developing an app with Angular and facing an issue with data sorting. The JSON sent back from the server is sorted by date, but when it reaches Angular, it gets alphabetically sorted. I need to maintain the original order. Users ...

<ol><li>Arranges elements in a peculiar way if the image is aligned to the left</li></ol>

Explore this comprehensive presentation on combining PDFs online. In this blog post, I have encountered two instances of <ol><li> formatting. The first one is styled properly using the following CSS: .post_content ul, .post_content ol ...

Is there a way to create a gradual fading effect on my images?

Check out the images currently on my portfolio page: .collection-type-gallery #slideshow .slide img:hover { opacity: 1; -webkit-transition: opacity 1s ease-in-out; -moz-transition: opacity 1s ease-in-out; -o-transition: opacity 1s ease ...

Scrollbar not displaying in Chrome when using overflow-y: scroll

I'm currently creating a list of organizations on the left side of this page: To create this list, I am using <span> tags that are linked to the corresponding map. However, I'm facing an issue - the scroll bar doesn't show up in Chro ...

Unexpected outcomes can occur when utilizing angular-tour across various views

Currently, I am attempting to utilize the angular-tour plugin to provide a brief tour of a website's functionality. My goal is to have tooltips appear on each icon located in the horizontal navbar. However, despite including the necessary scripts and ...

Tips for efficiently delivering the create-react-app index file from your server

I have encountered a challenge in my development work with create-react-app. I am looking to serve the index.html file from the backend initially, but I am facing difficulties in achieving this goal. The main reason behind this desire is to customize the ...

What is the best way to create an index for a user-provided value in a textbox

Looking for guidance on how to set an index to user-provided values in a textbox, append them to a table in a new row, and display that index in the first column of every row. I am unfamiliar with this type of functionality. $(document).ready(function() ...

Utilizing external Cascading Style Sheets in AngularJS 1

Can an external CSS be applied to a component in AngularJS1? If yes, then how can it be done? I have only seen examples of applying inline css... ...

ng-repeat creating blank anchor links

I'm currently working on developing a navigation menu using AngularJS. Each menu item can have sub-items, which requires an additional ng-repeat directive to display the submenu items. However, I've encountered some unusual behavior when trying t ...

Finding the correct path for the background-image URL in VueJS has been a challenge

Currently, I am learning VueJs and have encountered a roadblock in my journey. The issue I am facing is determining the correct path to specify for the URL of the background-image property in the CSS section of my component. <template> <div cla ...

How to access the CSS and JS files in the vendor folder using linemanjs

Currently, I am in the process of developing a web application utilizing linemanjs. However, I have encountered an issue where the vendor css and js files are not being referenced correctly when explicitly included. I would appreciate any guidance on what ...

Generate a unique HTML table for each row retrieved from a MySQL database with PHP

Is there a way to display each row from the database table as a separate HTML table? Instead of having one table for the entire database, I want each row to be displayed in its own table. How can this be achieved? Would it be advisable to use the integer ...

What is the best method for enclosing all text within an HTML document with a different element?

For example: FROM <div> whats up! <div> whats up2! </div> thank you for your help <div></div> </div> TO <div> <span>whats up!</span> <div><span> whats up2! </span&g ...