I have HTML string returned from an external API call. I want to compile that HTML string and get a compiled htmlElement by id 'test-input'. I keep getting null or undefined when getting an element from DOM. I am using the library for the p3x-angular-compile plugin:
I used ElementRef and tried querySelector on the nativeElement
. Still getting null.
this.template = '<div id="test-input"><input type="text"></div>';
What's expected is that once this template is rendered and compiled, I need the element in order to continue with other manipulation.