只是尝试根据用户点击的内容更改背景颜色
HTML:
<body ng-app="myApp" ng-controller="myCtrl" style="width:100%;height:100%;background-color:{{bc}};overflow-x:hidden;padding:0px;border:0px;margin:0;">
和
<div style="width:100%;height:20%;border:2px solid black;" ng-click="sports(FFE648);">
<img src="logo-01.svg" style="border:2px solid black;min-width:60px;min-height:60px;width:100%;height:55%;"/>
</div>
控制器:
<script>
var app = angular.module('myApp', []);
app.controller('myCtrl', function($scope, $timeout) {
$scope.sports=function(colorpick){
$scope.animation="animated4 bounceOutRightCustom";
$scope.animationleft="animated4 bounceOutLeftCustom";
$scope.bc=colorpick;
$timeout(function() {
$scope.animation="";
$scope.animationleft="";
}, 4100);
}
});
</script>
我不知道出了什么问题......应该是非常简单的解决方案:(