I am working on an Angular app where I need to increase the left offset of a div by 90px every time the slideThis()
function is called. In jQuery, I would typically achieve this using left: '+=90'
, but I'm struggling to find a similar method in AngularJS. Am I approaching this problem the wrong way?
HTML:
<div ng-style="myStyle"></div>
JavaScript:
$scope.slideThis = function() {
$scope.myStyle = {
left: '+=90'
}
}
I would greatly appreciate any guidance on how to implement this functionality in AngularJS!