我是 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/