0
角度4でtypescriptからhtmlへの入力要素を作成しようとしています。しかし、私が入力しようとすると、[(ngModel)]
は動作しません。どのように私はその方法を行うのですか?誰か知っている?document setAttribute ngModel Angular
createElement() {
this.input = document.createElement('input');
this.input.setAttribute('matInput', '');
this.input.setAttribute('placeholder', 'Tema');
this.input.setAttribute('[(ngModel)]', 'module.theme');
this.input.setAttribute('name', 'theme');
return (<HTMLDivElement>(document.getElementById('ejemplo').appendChild(this.input)));
}