I am creating a directive where you are able to pass different type of html elements and inject them into a table.
However sometimes my users might need to add some kind of expression to the ng-class directive
check for instance the following:
$scope.element =
{
html: '<button type="button" ng-class="element.classExpression">My button</button>',
classExpression : "element.classExpressionDefault ? 'btn-success': 'btn-danger'",
classExpressionDefault: $scope.inactive,
}
HTML:
<span ng-bind-html-unsafe="element.html"> </span>
Please note the above code does not work!
The problem with the above code is that the expression is not being evaluated and therefor it goes lost.
So my question is how may i add it and is it possible?