Bu yazıda typescript tarafta tanımlanmış bir değişken tipinden yardım alarak dinamik isimli click event'ı oluşturuyoruz.
Typescript tarafta Event isimlerimiz
- checkEN()
- checkTR()
- checkJP()
- checkCN()
- checkDE()
gibi isimler ise ve bunları ngFor ile dönülen bir değişken butonuyla kullanmak istiyorsak alttaki kod yapısını kullanmamız gereklidir.
<button (click)="this['check' + translation.language.substr(0,2)]()" type="button" name="phoneType_Type{{translation.language}}" id="PhoneType_Type{{translation.language}}" class="form-control"> </button>
Hiç yorum yok:
Yorum Gönder