Hi I have an image that I want to rotate. There are two buttons left and right which rotate the image 45 degrees in opposite directions. I tried creating a directive using
$scope.RotateImageRight = function () {
z = z + 1;
var img;
if (z === 1) {
img = document.getElementById("rotate90");
img.style.transform = "rotate(-90deg)";
img.style.width = "725px";
}
else if (z === 2) {
img = document.getElementById("rotate90");
img.style.transform = "rotate(-180deg)";
img.style.width = "870px";
}
else if (z === 3) {
img = document.getElementById("rotate90");
img.style.transform = "rotate(-270deg)";
img.style.width = "725px";
}
else if (z === 4) {
img = document.getElementById("rotate90");
img.style.transform = "rotate(-360deg)";
img.style.width = "870px";
} else {
z = 0;
}
}