I am handling my issue like this:
ng-style="{ width: getTheValue() }"
But to avoid having this function on the controller side, I would much prefer to do something like this:
ng-style="{ width: myObject.value == 'ok' ? '100%' : '0%' }"
How can I do this?
simple example:
<div ng-style="isTrue && {'background-color':'green'} || {'background-color': 'blue'}" style="width:200px;height:100px;border:1px solid gray;"></div>
{'background-color':'green'} RETURN true
OR the same result:
<div ng-style="isTrue && {'background-color':'green'}" style="width:200px;height:100px;border:1px solid gray;background-color: blue"></div>
other conditional possibility:
<div ng-style="count === 0 && {'background-color':'green'} || count === 1 && {'background-color':'yellow'}" style="width:200px;height:100px;border:1px solid gray;background-color: blue"></div>