这是我的controller.js代码:
$scope.animatt = 900;
这是我的HTML代码:
<div id="properties" data-{{animatt}}="left:100%;top:10%;">
<h2>all numeric properties</h2>
</div>
我想将'data-900 ='设置为'data - {{animatt}}',但此代码不起作用
答案 0 :(得分:0)
在您的控制器中,添加以下代码
var el =angular.element('#properties');
el.attr('data-' + $scope.animatt, 'left:100%;top:10%;');