您不能在属性内的JS字符串内使用大括号绑定。您可以将变量附加到字符串上:
<div ng->{{number}}</div>
另外,我用单打替换了双引号。
但是,您可以考虑向控制器添加函数以返回适当的样式:
控制器:
// Create a variable to store the transform value$scope.transform = "rotate(0deg)";// When the number changes, update the transform string$scope.$watch("number", function(val) { $scope.transform = "rotate("+val+"deg)";});
HTML:
<!-- We can now use the same value for all vendor prefixes --><div ng->{{number}}</div>
更新的柱塞
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)