Applying ng-style to entire *row* within ng-repeat ?

Applying ng-style to entire *row* within ng-repeat ?

I just can't believe this is not possible...

Currently I'm doing this, that can't be the right way...
<tr ng-repeat="item in items"> <td ng-style="apply_style(item)">{{item.name}}</td>
<td ng-style="apply_style(item)">{{item.level}}</td>
<td ng-style="apply_style(item)">{{item.code}}</td>
</tr>
 
עובד, תודה!

 

MoAtlow

New member
ng-class on tr

וטיפ חשוב (במידה וזה אכן מתאים למקרה כמובן):
תלוי בגרסת האנגולר שלך, (אאלט 1.3 ומעלה תומך בזה), אפשר לכתוב עם נקודותיים כפולות
<td style="{{::apply_style(item)}}">{{::item.name}}</td>
ככה שהערך נכנס רק בפעם הראשונה, ולא כל digest cycle.
וכמו שראית, המרתי את הng-style בסתם style בשביל זה.
 
למעלה