ng-class css样式

<style>
.error{background-color: red;}
.warning{background-color: yellow;}
</style>

<script>

  

app.controller("headerController",function($scope){
$scope.isError=false;
$scope.isWarning=false;
$scope.showError=function(){

$scope.messageText="this is an error";
$scope.isError=true;
$scope.isWarning=false;
}
$scope.showWarning=function(){
$scope.messageText="just a warning";
$scope.isError=false;
$scope.isWarning=true;
}
});

<script>

 

<body>

<div ng-controller="headerController">
<div ng-class=‘{error:isError,warning:isWarning}‘>{{messageText}}</div>
<button ng-click="showError()">error</button>
<button ng-click="showWarning()">warning</button>
</div>
</body>

 

 

ng-class css样式,布布扣,bubuko.com

ng-class css样式

上一篇:spark 划分stage Wide vs Narrow Dependencies 窄依赖 宽依赖 解析 作业 job stage 阶段 RDD有向无环图拆分 任务 Task 网络传输和计算开销 任务集 taskset


下一篇:Oracle 备份还原