Could a string retrieved from an external resource, such as an http response, be passed as a dynamic template that binds to the component's instance without relying on TemplateRef?
Context: Consider having an AppComponent with at least one variable name
, but lacking a predefined static template in the codebase. Instead, the HTML content will be fetched at runtime from an external source.
This template should be able to be injected and function like any normal template, with access to the name
property.
httpClient.get('template').then(val=>{
// val: '<div> {{name}} </div>'
this.template = val;
})