Ich möchte übergeordnete (searchres) in eckigen wählen und Stil bekommen, aber ich kann es nicht tun! Mein HTML ist dies:Wählen Sie das übergeordnete Element in eckig
<div ng-repeat="product in products" class="searchres">
<a href="#">
<img src="{{product.path}}" class="img-thumbnail" alt="{{product.name)}}" />
{{product.name}}
</a>
</div>
Und mein Code ist dies:
$.each($scope.products, function(index, value) {
var namePro = value.name;
if (namePro.length <= 32) {
$("body").find(".searchres").css("line-height","50px!important");// is wrong !
value.parentNode.css("line-height","50px!important"); // is wrong !
}
});
was soll ich für dieses Problem zu tun?
was Sie wollen und warum ich ng-Stil nicht ng-Stil –
verwendet: ng-style = "product.name.length <= 32 { 'line-height':‚50px! wichtig '}: {} ". aber es funktioniert nicht für mich! –