Consider this example:
$scope.element =
{
html: '<a type="button" class="btn btn-xs btn-rounded m-r-sm"><i class="icon icon-user-unfollow"></i></a>',
classExpression : " {{inactive == 'true' ? 'btn-success': 'btn-danger'}}",
}
In the code above, there is a variable named classExpression
which I want to add to the element.
<span ng-bind-html="element.html | trust" class="{{element.classExpression}}">Text in between<span>
Unfortunately, it does not get evaluated as expected.
My question is, how can this be achieved (if it is even possible)?
Check out my fiddle for reference.
I have updated my fiddle as it wasn't working correctly before.