I have created an Angular application and I am looking to extract the html
of a template from a large component, including the styles applied to the classes used. Can anyone advise on how to achieve this in Angular? Currently, I am attempting to use the following code snippet with innerHTML
:
const myTemplate = document.getElementById("someWrapperId");
const content = myContent.innerHTML;
However, this method does not return the styled html. I have also experimented with setting
encapsulation: ViewEncapsulation.None
, but this has not solved the issue either. The styles are defined in a separate component.css file and are not set inline.