0
我想知道是否有可能将参数从html传递给css文件。是这样的:将绑定参数传递给CSS
//css
.some-class [args]{
color: $(args.color|default:'#fff')
height: $(args.height|default:'50px')
}
//html
<body ng-app='App'>
<div ng-controlle="Ctrl">
<div ng-class='some-class${{element}}'></div>
</div>
</body>
//js
angular.module('App',[])
.controller('Ctrl',["$scope",function(){
$scope.$on('EchangeColor',function(newColor){
$scope.element.color = newColor
})
$scope.$on('EchangeHeight',function(newHeight){
$scope.element.height = newHeight
})
}])