[英]Angularjs - How to merge one bo-class with one ng-class using the lazy loading?
I am very confuse by the version 1.3+ of angularjs, before I was using bindonce and now we have the lazy loading with '::'. 在我使用bindonce之前,我对angularjs的1.3+版本感到非常困惑,现在我们使用'::'进行了延迟加载。
I didn't find how I can bind only one class of a multiple ng-class. 我没有找到如何绑定多个ng类中的一个类的方法。
This was my pevious code: 这是我先前的代码:
<a [...] bo-class="{'tuto': user.tutorial}" ng-class="{liked: liked == true}">[...]</a>
I need to use : ng-class" :: {'tuto': user.tutorial}" and to keep my second ng-class. 我需要使用:ng-class“ :: {'tuto':user.tutorial}”并保留第二个ng-class。
How I can do to merge one bo-class using lazy loading with one ng-class which is bind ? 如何将使用延迟加载的一个bo类与一个绑定的ng-class合并?
Thank you ! 谢谢 !
Try to use this an ugly workaround. 尝试使用此丑陋的解决方法。
<a
bo-attr
bo-attr-class="user.tutorial?'tuto':''"
ng-class="{liked: liked == true}">[...]</a>
for bo-class you can use: 对于bo级,您可以使用:
bo-class="{'class1' : condition1,'class2' : condition2}" bo-class =“ {'class1':condition1,'class2':condition2}”
and so on, basically you can have key value pairs that it will evaluate every pair. 依此类推,基本上您可以拥有将对每对值进行评估的键值对。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.