Angular ui-select css 不适用于 ui-bootstrap
Angular ui-select css not working with ui-bootstrap
我正在尝试在我的项目中使用 angular ui-select,但是 css 无法正常工作。
index.html:
<link rel="stylesheet" href="bower_components/bootstrap-social/bootstrap-social.css" />
<link rel="stylesheet" href="bower_components/angularjs-slider/dist/rzslider.css" />
<link rel="stylesheet" href="bower_components/angular-dropdowns/dist/angular-dropdowns.css" />
<link rel="stylesheet" href="bower_components/angular-loading-bar/build/loading-bar.css" />
<link rel="stylesheet" href="bower_components/textAngular/dist/textAngular.css" />
<link rel="stylesheet" href="bower_components/perfect-scrollbar/src/perfect-scrollbar.css" />
<link rel="stylesheet" href="bower_components/fullcalendar/dist/fullcalendar.css" />
<link rel="stylesheet" href="bower_components/angularjs-toaster/toaster.css" />
<link rel="stylesheet" href="bower_components/ngprogress/ngProgress.css" />
<link rel="stylesheet" href="bower_components/angular-ui-select/dist/select.css" />
<script src="bower_components/ng-file-upload-shim/ng-file-upload-shim.js"></script>
<script src="bower_components/perfect-scrollbar/src/perfect-scrollbar.js"></script>
<script src="bower_components/angular-perfect-scrollbar/src/angular-perfect-scrollbar.js"></script>
<script src="bower_components/moment/moment.js"></script>
<script src="bower_components/fullcalendar/dist/fullcalendar.js"></script>
<script src="bower_components/angular-ui-calendar/src/calendar.js"></script>
<script src="bower_components/angularjs-geolocation/src/geolocation.js"></script>
<script src="bower_components/angularjs-toaster/toaster.js"></script>
<script src="bower_components/ngprogress/build/ngProgress.js"></script>
<script src="bower_components/angular-ui-select/dist/select.js"></script>
包版本:
Angularjs: 1.4.5
ui-bootstrap: 0.11.2
Angular ui-select: 0.12.1
html 文件:
<ui-select ng-model="stream.selected" theme="select2" ng-disabled="disabled" style="min-width: 300px;">
<ui-select-match placeholder="Select a social profile in the list">{{$select.selected.name}}</ui-select-match>
<ui-select-choices repeat="profile in socialNetworks | filter: $select.search">
<div ng-bind-html="profile.name | highlight: $select.search"> </div>
</ui-select-choices>
</ui-select>
controller.js
'use strict';
angular.module('myApp')
.controller('AddStreamPopUpCtrl', function ($scope, $modalInstance, $state, socialNetworks, $modal) {
$scope.close = function () {
$modalInstance.dismiss('close');
};
$scope.cancel = function () {
$modalInstance.dismiss('cancel');
};
$scope.redirect = function() {
$state.go('dashboard.mailbox.inbox');
$modalInstance.dismiss('close');
};
$scope.socialNetworks = [{name:'test', value: 'someVal'}];
});
以上代码的结果类似于:
任何人都可以指点为什么这没有正确加载 css 吗?
Plunker example修改为不下载'select2.css'.
尝试
<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/select2/3.4.5/select2.css">
我正在尝试在我的项目中使用 angular ui-select,但是 css 无法正常工作。
index.html:
<link rel="stylesheet" href="bower_components/bootstrap-social/bootstrap-social.css" />
<link rel="stylesheet" href="bower_components/angularjs-slider/dist/rzslider.css" />
<link rel="stylesheet" href="bower_components/angular-dropdowns/dist/angular-dropdowns.css" />
<link rel="stylesheet" href="bower_components/angular-loading-bar/build/loading-bar.css" />
<link rel="stylesheet" href="bower_components/textAngular/dist/textAngular.css" />
<link rel="stylesheet" href="bower_components/perfect-scrollbar/src/perfect-scrollbar.css" />
<link rel="stylesheet" href="bower_components/fullcalendar/dist/fullcalendar.css" />
<link rel="stylesheet" href="bower_components/angularjs-toaster/toaster.css" />
<link rel="stylesheet" href="bower_components/ngprogress/ngProgress.css" />
<link rel="stylesheet" href="bower_components/angular-ui-select/dist/select.css" />
<script src="bower_components/ng-file-upload-shim/ng-file-upload-shim.js"></script>
<script src="bower_components/perfect-scrollbar/src/perfect-scrollbar.js"></script>
<script src="bower_components/angular-perfect-scrollbar/src/angular-perfect-scrollbar.js"></script>
<script src="bower_components/moment/moment.js"></script>
<script src="bower_components/fullcalendar/dist/fullcalendar.js"></script>
<script src="bower_components/angular-ui-calendar/src/calendar.js"></script>
<script src="bower_components/angularjs-geolocation/src/geolocation.js"></script>
<script src="bower_components/angularjs-toaster/toaster.js"></script>
<script src="bower_components/ngprogress/build/ngProgress.js"></script>
<script src="bower_components/angular-ui-select/dist/select.js"></script>
包版本:
Angularjs: 1.4.5
ui-bootstrap: 0.11.2
Angular ui-select: 0.12.1
html 文件:
<ui-select ng-model="stream.selected" theme="select2" ng-disabled="disabled" style="min-width: 300px;">
<ui-select-match placeholder="Select a social profile in the list">{{$select.selected.name}}</ui-select-match>
<ui-select-choices repeat="profile in socialNetworks | filter: $select.search">
<div ng-bind-html="profile.name | highlight: $select.search"> </div>
</ui-select-choices>
</ui-select>
controller.js
'use strict';
angular.module('myApp')
.controller('AddStreamPopUpCtrl', function ($scope, $modalInstance, $state, socialNetworks, $modal) {
$scope.close = function () {
$modalInstance.dismiss('close');
};
$scope.cancel = function () {
$modalInstance.dismiss('cancel');
};
$scope.redirect = function() {
$state.go('dashboard.mailbox.inbox');
$modalInstance.dismiss('close');
};
$scope.socialNetworks = [{name:'test', value: 'someVal'}];
});
以上代码的结果类似于:
任何人都可以指点为什么这没有正确加载 css 吗?
Plunker example修改为不下载'select2.css'.
尝试
<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/select2/3.4.5/select2.css">