Angular newbie here, I am trying to create a button that will have an icon inside of it rotate 360 degrees once click on. As of now I have the rotate but it rotates the whole button instead of just the element. Looking to just have it rotate the "blue square" when the button is clicked. (And yes I understand as of now I am only having the button itself rotate due to ng-click being on the button and nothing on the div.box)
HTML Code:
<button ng-controller="fullRotation" ng-click="fullRotate()">Rotate
<div class="box"></div>
</button>
NG Code
var app = angular.module('app', []);
var fullRotation = function ($scope, $element) {
var degrees = 360;
$element.css('transition', '-webkit-transform 800ms ease');
$scope.fullRotate = function() {
$element.css('-webkit-transform', 'rotate(' + degrees + 'deg)');
degrees += 360;
};
}