我有一个样式对象,我只需要为第一个元素设置另一个 CSS 样式。我专门为此创建了一个指令,但它不起作用
我会感谢你的帮助!
这是代码:
<div class="row" ng-style="rowCss" ng-repeat="top in gridObj" ng-zero>
$scope.rowCss = {
"height" : rowAndSquareHeight,
"padding-top": baseLine
}
editorApp.directive('ngZero', ['$document', '$parse', function($document, $parse) {
return function(scope, element, attr) {
$(element).css({"padding-top" : "0px"});
};
}]);
谢谢!