1

I am very confuse by the version 1.3+ of angularjs, before I was using bindonce and now we have the lazy loading with '::'.

I didn't find how I can bind only one class of a multiple ng-class.

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.

How I can do to merge one bo-class using lazy loading with one ng-class which is bind ?

Thank you !

2 Answers2

1

Try to use this an ugly workaround.

<a 
  bo-attr 
  bo-attr-class="user.tutorial?'tuto':''" 
  ng-class="{liked: liked == true}">[...]</a>
limitium
  • 260
  • 1
  • 5
  • 10
  • I don't want to use bindonce (bo-*) anymore. I want to use the official bindonce of angularjs using ::. For example : [...] But as you see, it won't work because I can't have two time the attribute ng-class. – Pierre Gourlaouen Feb 08 '15 at 13:17
0

for bo-class you can use:

bo-class="{'class1' : condition1,'class2' : condition2}"

and so on, basically you can have key value pairs that it will evaluate every pair.

Mustafa
  • 147
  • 1
  • 1
  • 9