I', trying to add a html control dynamically to div and after creating the control I would like to perform operations on it by creating viewchild
@ViewChild('dropDownListReference') myDropDownList: typeOfComponent
able to create in class but in a method after generating the control cannot initialize this
AddLevelClick() {
var el: HTMLElement = document.getElementById('multi-sort-body');
el.innerHTML = "<div #test1></div>";
@ViewChild('test1') myDropDownList: typeOfComponent // Unable to create here
}
Any clue on creating ViewChild element locally?