Angular Material Select
home
Run
screen_rotation
fullscreen
cloud_download
navigate_before
navigate_next
<html lang="en" > <head> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/angular-material/1.1.1/angular-material.min.css"> <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script> <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular-animate.min.js"></script> <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular-aria.min.js"></script> <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular-messages.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/angular-material/1.1.1/angular-material.min.js"></script> <link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons"> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700,400italic"> <script language="javascript"> angular .module('myApp', ['ngMaterial']) .controller('MyController', function ($scope, $mdDialog) { $scope.users = [ { id: 1, name: 'Yeli' }, { id: 2, name: 'John' }, { id: 3, name: 'James' } ]; $scope.usersModel = { id: 1, name: 'Yeli' }; // This is used to set default Selected }); </script> </head> <body ng-app="myApp"> <div ng-controller="MyController as ctrl" ng-cloak="" > <md-content layout-padding> <md-select ng-model="usersModel"> <md-option ng-value="user" ng-repeat="user in users">{{ user.name }}</md-option> </md-select> </md-content> </div> </body> </html>
<html lang="en" > <head> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/angular-material/1.1.1/angular-material.min.css"> <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script> <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular-animate.min.js"></script> <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular-aria.min.js"></script> <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular-messages.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/angular-material/1.1.1/angular-material.min.js"></script> <link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons"> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700,400italic"> <script language="javascript"> angular .module('myApp', ['ngMaterial']) .controller('MyController', function ($scope, $mdDialog) { $scope.users = [ { id: 1, name: 'Yeli' }, { id: 2, name: 'John' }, { id: 3, name: 'James' } ]; $scope.usersModel = { id: 1, name: 'Yeli' }; // This is used to set default Selected }); </script> </head> <body ng-app="myApp"> <div ng-controller="MyController as ctrl" ng-cloak="" > <md-content layout-padding> <md-select ng-model="usersModel"> <md-option ng-value="user" ng-repeat="user in users">{{ user.name }}</md-option> </md-select> </md-content> </div> </body> </html>
Copyrights@tutorialsplane.com