[英]How to display infinity symbol in AngularJS
我想在我的網頁中有條件地顯示值或無窮大符號。
我想做這樣的事......
<td class="rs-table-text" ng-if="batch.est_completion_time ">{{batch.est_completion_time}}</td>
也就是說, if batch.est_completion_time is not empty then display whatever is coming from json
。
而json
看起來像:
{
"batch_queue_name": "Batch Five",
"start_date": "05/01/2017 12:18 A.M.",
"end_date": "08/01/2017 03:37 A.M.",
"est_completion_time":"∞",
"completion_status": "42"
}
但it does not display the infinity symbol. Rather , it displays the ∞ text only.
it does not display the infinity symbol. Rather , it displays the ∞ text only.
如何實現相同?
在控制器中,准備如下數據:
$scope.est_completion_time = $sce.trustAsHtml(batch.est_completion_time);
在HTML中,您可以按原樣顯示它。 不要忘記在外部DOM元素中添加ng-bind-html
。
僅添加ng-bind-html
可以完成這項工作:
ng-bind-html="batch.est_completion_time"
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.