Css 如何在angular中动态更改样式表?
我正在尝试更改bootstrap.css文件以更改我的应用程序的主题:Css 如何在angular中动态更改样式表?,css,angularjs,twitter-bootstrap,Css,Angularjs,Twitter Bootstrap,我正在尝试更改bootstrap.css文件以更改我的应用程序的主题: $scope.changeStyle = function (style) { $scope.myStyle = style + '/bootstrap.min.css'; $scope.$apply(); } Mystyle在html中定义: <link rel="stylesheet" href="{{myStyle}}"> 问题是如何让它工作?这里有一个plunkr引用:似乎您的更改
$scope.changeStyle = function (style) {
$scope.myStyle = style + '/bootstrap.min.css';
$scope.$apply();
}
Mystyle在html中定义:
<link rel="stylesheet" href="{{myStyle}}">
问题是如何让它工作?这里有一个plunkr引用:似乎您的更改事件没有被触发。你可以这样做
<ul class="dropdown-menu" role="menu" aria-labelledby="dropdownCountry">
<li ng-repeat="country in data.locations.countries | orderBy:'country'" ng-model="country.Capital">
<a ng-click="changeStyle(country.Capital)">{{country.country}}</a>
</li>
</ul>
-
可能存在的副本