1
結合我有這樣低於組件:如何CSS樣式從打字稿方法與角度
@Component({
selector: 'app-car-item',
templateUrl: './car-item.component.html',
styleUrls: ['./car-item.component.css'],
})
export class CarItemComponent {
public style: string
addStyle() {
this.style = 'font-size: 20px'
}
我如何能實現addStyle()
方法來改變字體大小在汽車item.component.css?
對不起,我是Angular的新手。我在哪裏必須添加這一行:[style.font-size.px] =「{{fontSize}}」? – Luki
在你想要改變字體大小的模板上: