In my Angular app I have a div whose left offset I'd like to increase by 90px every time the slideThis()
function gets called. In jQuery I'd do this by specifying something like left: '+=90'
, however as far as I can see there seems to be no equivalent or comparable method for doing that in AngularJS - or am I following the completely wrong approach?
HTML:
<div ng-style="myStyle"></div>
JS:
$scope.slideThis = function() {
$scope.myStyle = {
left: '+=90'
}
}
Would really appreciate any advice on how to go about something like this!
myStyle
needs to return valid style syntax as used instyle="...."
. Not clear what you are trying to add to.