JSFiddle - React, Tailwind, and code Playground
by Freewind
HTML
<!doctype html>
<html ng-app>
<script src="http://code.angularjs.org/angular-1.0.0rc3.min.js"></script>
<script>
function XCtrl($scope) {
$scope.messages = ["aaa","bbb"];
$scope.del = function(index) {
// ! how to add the `.deleting` style to the element?
if(confirm("delete it?")) {
$scope.messages.splice(index,1);
} else {
// ! how to remove the `.deleting`?
}
}
}
</script>
<body>
<div ng-controller="XCtrl">
<div ng-repeat="m in messages">
<div>
{{m}}
<button ng-click="del($index)">Delete</button>
</div>
</div>
</div>
</body>
</html>
CSS
.deleting {
background-color: red;
}