Topic: options with class="mdb -select" are not displayed
gabrielsule asked 8 years ago
$scope.options = {
1: "Partner",
2: "Owner",
3: "Client"
};
$scope.selected = company.data.id_companytype.toString();
<select ng-model="selected" ng-options="key as val for (key,val) in options" class="browser-default"></select>
<br>
<select ng-model="selected" ng-options="key as val for (key,val) in options" class="mdb-select"></select>
umair answered 8 years ago
Bartłomiej Malanowski staff pro premium answered 8 years ago
<script>
$(document).ready(function() {
$('.mdb-select').material_select();
});
</script>
gabrielsule answered 8 years ago
<script>
$(document).ready(function () {
$('.datepicker').pickadate();
$('.mdb-select').material_select();
});
</script>
Bartłomiej Malanowski staff pro premium answered 8 years ago
<body ng-app="app" ng-controller="MainController">
<select ng-model="selected" ng-options="key as val for (key,val) in options" ng-selected="key == 0" class="mdb-select"></select>
<!-- SCRIPTS -->
<!-- Angular 1.5.8 -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.5.8/angular.min.js"></script>
<!-- JQuery -->
<script type="text/javascript" src="js/jquery-2.2.3.min.js"></script>
<!-- Bootstrap tooltips -->
<script type="text/javascript" src="js/tether.min.js"></script>
<!-- Bootstrap core JavaScript -->
<script type="text/javascript" src="js/bootstrap.min.js"></script>
<!-- MDB core JavaScript -->
<script type="text/javascript" src="js/mdb.min.js"></script>
<script type="text/javascript">
(function() {
var app = angular.module('app', []);
app.controller('MainController', function($scope) {
$scope.options = {
1: "Partner",
2: "Owner",
3: "Client"
};
});
})();
$(document).ready(function () {
$('.mdb-select').material_select();
});
</script>
</body>
gabrielsule answered 8 years ago
<select ng-model="selected" ng-options="key as val for (key,val) in options" class="browser-default ng-pristine ng-untouched ng-valid ng-not-empty">
<option label="Partner" value="string:1">Partner</option>
<option label="Owner" value="string:2" selected="selected">Owner</option>
<option label="Client" value="string:3">Client</option>
</select>
<div class="select-wrapper mdb-select ng-pristine ng-untouched ng-valid ng-empty">
<span class="caret">▼</span>
<input type="text" class="select-dropdown" readonly="true" data-activates="select-options-a733b62b-f88e-d752-1ab3-4d78f4f06fe4" value="">
<ul id="select-options-a733b62b-f88e-d752-1ab3-4d78f4f06fe4" class="dropdown-content select-dropdown">
<li class=""><span></span></li>
</ul>
<select ng-model="selected" ng-options="key as val for (key,val) in options" class="mdb-select ng-pristine ng-untouched ng-valid initialized ng-not-empty">
<option label="Partner" value="string:1">Partner</option>
<option label="Owner" value="string:2" selected="selected">Owner</option>
<option label="Client" value="string:3">Client</option>
</select>
</div>
Bartłomiej Malanowski staff pro premium answered 8 years ago
<body ng-app="app" ng-controller="MainController">
<select ng-model="selected" ng-options="key as key.name for key in options track by key.value" class="mdb-select">
<option value="" disabled selected>Choose your option</option>
</select>
<!-- SCRIPTS -->
<!-- Angular 1.5.8 -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.5.8/angular.min.js"></script>
<!-- JQuery -->
<script type="text/javascript" src="js/jquery-2.2.3.min.js"></script>
<!-- Bootstrap tooltips -->
<script type="text/javascript" src="js/tether.min.js"></script>
<!-- Bootstrap core JavaScript -->
<script type="text/javascript" src="js/bootstrap.min.js"></script>
<!-- MDB core JavaScript -->
<script type="text/javascript" src="js/mdb.min.js"></script>
<script type="text/javascript">
(function() {
var app = angular.module('app', []);
app.controller('MainController', function($scope) {
$scope.options = [
{ value: "1", name: "Partner" },
{ value: "2", name: "Owner" },
{ value: "3", name: "Client" }
];
});
})();
$(document).ready(function () {
$('.mdb-select').material_select();
});
</script>
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Resolved
- User: Free
- Premium support: No
- Technology: MDB Angular
- MDB Version: -
- Device: -
- Browser: -
- OS: -
- Provided sample code: No
- Provided link: No