を色を変更する必要がある - CodePen
マークアップ
<div ng-controller="AppCtrl" ng-cloak="" ng-app="MyApp">
<md-card class="md-padding" animate-on-change="currentCard" class="col-md-8" style="background:{{currentCard.redAlert?'red':'blue'}}" >
<md-card-content>
</md-card-content>
</md-card>
<md-button class="md-raised md-primary" ng-click="toggle()">Toggle</md-button>
</div>
JSは
angular.module('MyApp',['ngMaterial', 'ngMessages'])
.controller('AppCtrl', function($scope) {
$scope.currentCard = {
redAlert: true
};
$scope.toggle = function() {
$scope.currentCard.redAlert = !$scope.currentCard.redAlert;
}
});
あなたの状態を言及し、質問を更新する –
@SharanDeSilva:更新された –