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
I just wanted to tell you my solution about rotating.
Here rd states for rotate degree time(x1,x2,x3,x4 -x4 =360 then resetting it to 0 ) Say that you have an ng-repeat for images in there created img ids.and in this span's ng-click I rotate the image by applying css .
$scope.RotateImage = function (id,deg) {
var deg = 90 * deg;
$('#' + id).css({
'-webkit-transform': 'rotate(' + deg + 'deg)', //Safari 3.1+, Chrome
'-moz-transform': 'rotate(' + deg + 'deg)', //Firefox 3.5-15
'-ms-transform': 'rotate(' + deg + 'deg)', //IE9+
'-o-transform': 'rotate(' + deg + 'deg)', //Opera 10.5-12.00
'transform': 'rotate(' + deg + 'deg)' //Firefox 16+, Opera 12.50+
});
}
Just take as an Alternative , any comments will be appreciated .