gpt4 book ai didi

css - 将 Angular 中的标题大写

转载 作者:太空宇宙 更新时间:2023-11-03 22:17:24 25 4
gpt4 key购买 nike

我是 Angular 的新手,我需要一些关于这段代码的帮助:

<ng-template #ballOutOfPlay>
<h1 class="event_title" [innerHTML]="eventService.currentStat ?.data.text" ></h1>
</ng-template>

这是存储在我正在显示的变量中的字符串(这是我想大写的那个):

eventService.currentStat.data.text = '<p>Ball out of match</p>'

我试过下面的方法,但没用,顺便说一句,我不能去掉

标签:

<ng-template #ballOutOfPlay>
<h1 class="event_title" *ngIf="eventService.currentStat && eventService.currentStat.data.text === '<p>Ball out of play</p>'" >
{{ eventService.currentStat.data.text | upperCase }}
</h1>
</ng-template>

最佳答案

你正在使用 Camel 大小写的大写,试试所有小写

 {{ eventService.currentStat.data.text | uppercase }}

关于css - 将 Angular 中的标题大写,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55919655/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com