Sha*_*per 1 angularjs ng-style
我有一个样式对象,我需要为第一个元素设置另一个css样式.我特别为此创建了一个指令,但它不起作用
我将非常感谢你的帮助!
这是代码:
<div class="row" ng-style="rowCss" ng-repeat="top in gridObj" ng-zero>
Run Code Online (Sandbox Code Playgroud)
$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"});
};
}]);
Run Code Online (Sandbox Code Playgroud)
谢谢!
<div class="row"
ng-style="{ true : rowCss }[$first]"
ng-repeat="top in gridObj">
...
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3753 次 |
| 最近记录: |