I'm trying to use the styleUrls
property when declaring my Angular 2 component to take advantage of View Encapsulation but there seems to be a problem when elements get inserted into the DOM after Angular has its completed initialization.
My situation is with a PrimeNG paginator that I currently can't style since it doesn't get applied a scope by Angular.
See below the <p-datatable>
element has a scope (it existed in the original markup) but <p-paginator>
does not (was added to DOM after the fact).
Therefore the style inserted by Angular into HEAD
does not match my elements:
<style>
p-datatable[_ngcontent-xnm-4] p-paginator[_ngcontent-xnm-4]:not(:first-child) {
display: none;
}
</style>
Is this a limitation of view encapsulation in Angular 2 or is there a way to have it "re-scope" the DOM on demand?
edited for typo and clarified title