I am trying create an input element from typescript to html in angular 4. But when I try put [(ngModel)] not works. How I do that method ? Someone know how ?
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)));
}