[英]How to add placeholder in the select tag in angular Typescript?
[英]How add Typescript variable value to Angular div tag?
如何通過單擊 Typescript 代碼中的按鈕將值聲明為“x”
<div>
<h3 >{{this.x}}</h3>
</div>
在你的 TS 文件中添加這個
x: any;
changeX(){
this.x = your value;
}
在您的 HTML 文件中添加此
<button (click)="changeX()"></button>
<div>
<h3 >{{x}}</h3>
</div>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.