カルヤンを与えたソリューションは、素晴らしいと少ないコードです。コントローラでは
<tr ng-repeat="ticket in requests">
<td><a href="{{ticket.Link}}">{{ticket.Id}}</a></td>
<td class="center" ng-bind-html="ticket.ApproverOne"></td>
<td class="center" ng-bind-html="ticket.ApproverTwo"></td>
<td class="center" ng-bind-html="ticket.ApproverThree"></td>
</tr>
:HTMLで :私はちょうど私が見つけた別の解決策を投稿したかった
thumbsdown = "<i class='fa fa-thumbs-o-down' aria-hidden='true' title='Rejected'></i>";
check = "<i class='fa fa-check' aria-hidden='true' title='Approved'></i>";
progress = "<i class='fa fa-hourglass-end' aria-hidden='true' title='In progress'></i>";
sentBack = "<i class='fa fa-reply' aria-hidden='true' title='Sent back'></i>";
noAction = "N/A";
//Approver One
if(approverOneAction){
if(approverOneAction == "In progress"){
approverOneAction = progress;
}
if (approverOneAction == "Approved") {
approverOneAction = check;
}
if (approverOneAction == "Rejected") {
approverOneAction = thumbsdown;
}
if (approverOneAction == "Sent back") {
approverOneAction = sentBack;
}
}else{
approverOneAction = noAction;
}
//Approver 2
if (approverTwoAction) {
if(approverTwoAction == "In progress"){
approverTwoAction = progress;
}
if (approverTwoAction == "Approved") {
approverTwoAction = check;
}
if (approverTwoAction == "Rejected") {
approverTwoAction = thumbsdown;
}
if (approverTwoAction == "Sent back") {
approverTwoAction = sentBack;
}
}else {
approverTwoAction = noAction;
}
//Approver 3
if (approverThreeAction) {
if (approverThreeAction == "In progress") {
approverThreeAction = progress;
}
if (approverThreeAction == "Approved") {
approverThreeAction = check;
}
if (approverThreeAction == "Rejected") {
approverThreeAction = thumbsdown;
}
if (approverThreeAction == "Sent back") {
approverThreeAction = sentBack;
}
} else {
approverThreeAction = noAction;
}
これはAngularJSよりもCSSの質問のような、より思えるNG-クラス – Edison
について何。 ':: before'擬似要素を使用してコンテンツを挿入すると、この場合FontAwesomeアイコンが表示されます。 –
一般的なフォントのすばらしいクラスで空の 'i'タグを追加し、必要なアイコンのクラスを追加するのはどうですか? たとえば、あなたは '$ scope.icon1 ="を渡すことができます。例えば、あなたは '$ i.png ' fa-check "と表示され、アイコンはチェックアイコンになります。 – user8672473