Angular Material Drop Down menu with UI-Router Integration

When the user clicks on the person icon, it triggers a form (form.html) using the ui-router logic defined in app.js. There are two types of dropdown boxes - one using the select tag and the other using the md-select tag. Everything works fine until I click on the second dropdown, which doesn't open the dropdown options window; instead, it freezes the page. I have included the code here on Plunker, although the page routing may not work there. You can refer to the code below for reference.

index.html

<body ng-app="myApp">
            <div class="col-sm-3 sidenav">
                <div class="well"> <!-- container to hold status bar and form -->
                    <nav class="navbar navbar-default navbar-custom">
                        <a style="font-size:2.5em;position: absolute; left: 50%;" ui-sref="form"><span class="glyphicon glyphicon-user fa-5x" id="Icon"></span></a>
                    </nav>

                    <div class="column-nav-form" ui-view="formColumn" >  <!--holds the form -->
                    </div>
                </div> 
            </div>
    </body>

form.html

<body>
<div ng-app="myApp" ng-controller="myCtrl">
    <h4> Normal DropDown </h4>
    <select ng-model="selectedName" ng-options="x for x in names">
    </select>
</div>
<p>I have three elements in my list, you should be able to pick whichever you like</p>
<div ng-app="myApp" ng-controller="myCtrl">
    <h4> Material DropDown </h4>
    <md-select onclick='console.log("clicked")' ng-model="selectedFilter" placeholder="Select a filter">                             <md-select-label>{{ selectedFilter.name }}</md-select-label> 
        <md-option ng-value="opt" ng-repeat="opt in filters">{{ opt.name }}</md-option>
    </md-select>
</div>
</body>

app.js

var myApp = angular.module('myApp', [ 'ngAnimate', 'ngAria', 'ui.bootstrap', 'ngMaterial', 'ngMessages', 'ui.router' ]);

//routing
angular.module('myApp').config(function ($stateProvider){

    $stateProvider
        .state('form', {
        url:"/form",
            views:  {
                "listColumn": {

                  },
                "formColumn": {
                      templateUrl: "/form.html"
                  } 
            }
        })  
});

//dropdown
myApp.controller('myCtrl', function($scope) {
    //log
    console.log($scope.names);
    $scope.names = ["Emil", "Tobias", "Linus"];

    $scope.filters = [
            {
                value: 'mine',
                name: 'Assigned to me'
            },
            {
                value: 'undefined',
                name: 'Unassigned'
            },
            {
                value: 'all',
                name: 'All Tickets'
            },
            {
                value: 'new',
                name: 'New Tickets'
            }
        ];

    //log
    console.log($scope.filters);
    console.log($scope.selectedFilter);
});

http://plnkr.co/edit/SB7MUM44Ly01aWyL5M28?p=preview

View upon clicking person icon

https://i.sstatic.net/jhO61.png Note: Dropdown for md-select doesn't load.

Thank you in advance

Answer №1

The issue was resolved by ensuring both the .css and .js versions were the same.

angular-material.js (v 1.0.6)
angular-material.css (v 1.0.6)

Here are the updated links:

<link rel="stylesheet" href="https://rawgit.com/angular/bower-material/master/angular-material.css">
<script src="https://rawgit.com/angular/bower-material/master/angular-material.js"></script>-->

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

Can we determine whether the current change in route is due to a redirect rule?

After creating an angular module that dynamically loads content based on the current $location.path, I configured the module as follows: var app = angular.module('App',['ngRoute']). config( ['$routeProvider','$locati ...

Error with Ajax-bound selection (dropdown) - possibly due to an empty list in certain browsers

Upon taking over a project involving ASP.Net AJAX and JSON, I encountered an issue on a page that loads a large select (combo box) list of 1,430 entries. This list loads successfully on our main search page but produces an error in MicrosoftAjaxTemplates.d ...

Implementing Asynchronous Custom Validators in Angular 4

I've encountered the following code snippet: HTML: <div [class]="new_workflow_row_class" id="new_workflow_row"> <div class="col-sm-6"> <label class="checkmark-container" i18n>New Workflow <input type="che ...

Error in pairing AngularJS with PHP

This is my code snippet: <script> var app = angular.module('myApp', []); app.controller('customersCtrl', function($scope, $http) { $http.get("http://ip/ss.php") .then(function (response) {$scope.names = response.data.record ...

Save various checkbox options to firebase

Utilizing Angularfire, my goal is to save data using multiple checkboxes. HTML <form role="form" ng-submit="addTask(task)"> <label class="checkbox-inline" ng-repeat="(key, value) in students"> <input type="checkbox" id="{{key}}" valu ...

Assist me with Twitter

Seeking assistance with a coding issue related to displaying Twitter posts on a website. I have found a code snippet that accomplishes this: //Scrolling of tweets in the footer $(function () { var tweetVP = $("#footerTweetsViewport"); arrTweetNav ...

Setting up a React Package by reinstalling a git repository

While immersing myself in learning React JS, I decided to create a git repository containing React components that could be exported and used or installed as a package in a separate React application. I developed some UI Components in a git repository and ...

What could be causing the error with firebase Sign In in next.js?

I set up a sign in page to enter email and password for Firebase authentication. The sign up process works fine, but I'm encountering an issue with the sign in functionality. 'use client' import { useState } from 'react'; import { ...

Disable button with Checkbox Javascript functionality

In my PHP code, I have an array of users that I pass to the view (in Laravel) and use a foreach loop to display all users in a table. Everything is working fine so far. However, I want to make a "send" button visible when a checkbox is clicked, instead of ...

The custom css class is failing to be applied to a tooltip within Angular Material version 15

After updating Angular Material to version 15, I noticed that I can no longer apply custom coloring to the material tooltip. Here is an example code in .html: <button mat-raised-button matTooltip="Tooltip message" matTooltipClass="cu ...

How to direct the main route to a sub route using AngularJS

The main template Home has two sub-templates called section1 and section2. Below is the routing code for reference: $urlRouterProvider.otherwise('/home/section1'); $stateProvider .state('home', { url: &apo ...

Vue paginated select with dynamic data loading

My API has a endpoint that provides a list of countries. The endpoint accepts the following query parameters: searchQuery // optional search string startFrom // index to start from count // number of options to return For example, a request with searchQu ...

Component built in ReactJS for file uploads to a server running on Spring MVC/Data-REST

For quite some time, I have been on the lookout for a ReactJS component that enables file uploading from a browser, with the ability to save it to the server where the ReactJS application is deployed. I've come across several components that facilita ...

Having trouble connecting the HTML file with the JavaScript file

This is my unique HTML file <!DOCTYPE html> <html> <head> <script src="ll.js"></script> </head> <body> <link rel="stylesheet" href="home.css"> ...

In one application, there are two connections established with mongoose. The purpose of the second connection is to establish a dependency on the

Seeking advice: I am facing an issue where I need to establish two separate connections to the database. The first database contains login information, while the second holds all other relevant data. Can this be achieved through integration of Node.js, m ...

Vue's computed property failing to compute

I have developed an ecommerce application using Vue.js, and here is a snippet of the store configuration: state: { cart: [], totalItems: { count: 0 } }, getters: { totalItems(){ if(window.localStorage.totalItems){ return ...

Unable to bring JavaScript into an HTML document

I am diving into the fundamentals of JS and HTML, starting with a simple script. Here is my test.js file: document.getElementById("test").innerHTML = "Loaded js file"; And here is my test.html: <!DOCTYPE HTML> <html lang="de"> <head> & ...

Is there a way to execute code right before the jQuery submit() function is run?

I'm currently facing an issue with executing codes before a validation function runs in my form. I have tried different methods including referring to How to order events bound with jQuery, but without success. This is the code snippet I am working w ...

Mastering Authentication in React JS: Best Practices

I am currently working on integrating Backend (Express JS) and Frontend (React JS). One of the challenges I am facing is understanding how to manage sessions effectively. When a user logs in using a form built with React JS, the backend responds with a HS ...

What is the best way to utilize TypeScript module augmentation with material-ui components?

I have gone through the answers provided in this source and also here in this link, but it appears that they are outdated. I attempted to enhance the type definition for the button component in various ways, including a separate typings file (.d.ts) as we ...