1
Good night!
I need to insert into an Angular-to-tag array <sup></sup>
, I searched but found no solution.
In the browser being rendered: Decree n<sup>
the</sup>
32.231, 09.03.2020 - Dom Salvador, 10.03.20200.
Could you help me please?
app.component.html
<app-act-card></app-act-card>
Act-card.component.html
<div *ngFor="let i of laws">
<p>{{i.decree}}</p>
</div>
Act-card.component.ts
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-act-card',
templateUrl: './act-card.component.html',
styleUrls: ['./act-card.component.scss']
})
export class ActCardComponent implements OnInit {
public laws = [
{
decree: 'Decreto n<sup>o</sup> 32.231, de 09.03.2020 - DOM Salvador de 10.03.20200',
}
];
}
You can’t just use the "°" character (on my keyboard it’s
alt gr
+?
)?– Costamilam
@Costamilam, using special characters directly in an HTML file can cause problems of character map.
– Lucas Samuel
@Lucassamuel only if you need compatibility with old or very bad browsers
– Costamilam
Regardless, it’s not recommended. In the company where I work, charset generated problems because of the different OS’s and browsers used by our users. We had to change all accents to compatible ratings.
– Lucas Samuel
Thank you all! I know this is not good practice, but I need to deliver a functional mockup to the backend team, they will try to consume this information correctly.
– Munir Baarini