Angularjs 带html的角三元组

Angularjs 带html的角三元组,angularjs,Angularjs,如何在三元运算符中包含html {{ (q.result === 1) ? "<i class="fa fa-check" aria-hidden="true"></i>" ? "<i class="fa fa-times" aria-hidden="true"></i>" }} {(q.result==1)?“”?“”} 如果不可能,我想明显的替代方法是使用HTML和其他HTML完成两个包装元素块,您可以使用ng类完成所需的操作。它实际上支持

如何在三元运算符中包含html

{{ (q.result === 1) ? "<i class="fa fa-check" aria-hidden="true"></i>" ? "<i class="fa fa-times" aria-hidden="true"></i>" }}
{(q.result==1)?“”?“”}

如果不可能,我想明显的替代方法是使用
HTML
其他HTML

完成两个包装元素块,您可以使用ng类完成所需的操作。它实际上支持三元运算符

<i class="fa" aria-hidden="true" ng-class"(q.result === 1) ? 'fa-check' : 'fa-times'"></i>

您可以通过ng类完成您想要的内容。它实际上支持三元运算符

<i class="fa" aria-hidden="true" ng-class"(q.result === 1) ? 'fa-check' : 'fa-times'"></i>

如果要更改类,请使用条件ng类

<i ng-class="q.result===1 ? 'fa fa-check' : 'fa fa-times' " aria-hidden="true">

如果要更改类,请使用条件ng类

<i ng-class="q.result===1 ? 'fa fa-check' : 'fa fa-times' " aria-hidden="true">