Stop Rotation
Hi,
I am using the below script to rotate the model.
var timerId = -1;
var angleIncrement = 5; // degrees
var timingInterval = 30; // milliseconds
$scope.rotateModel = function(){
if (timerId > -1) {
clearInterval(timerId);
}
timerId = setInterval(function() {
if (!$scope.app.params.ry) {
$scope.app.params.ry = 0;
}
$scope.$apply(function(){
$scope.app.params.ry += angleIncrement % 360;
});
}, timingInterval);
};
But the below code which I using to stop rotation does not seem to work.
$scope.stoprotate = function() {
$interval.cancel($scope.rotateModel);
}
Any help in this regard will be great!!!

