@porsche-design-system/components-angular looks like this.@NgModule({
declarations: [AppComponent],
imports: [BrowserModule, AppRoutingModule, PorscheDesignSystemModule],
providers: [],
bootstrap: [AppComponent],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
export class AppModule {}
PorscheDesignSystemModule is calling load() of @porsche-design-system/components-js since the web
components are exactly the same. In fact, the framework specific packages like
@porsche-design-system/components-angular only provide thin wrapper components for typing, prop binding and good
developer experience just like with any other Angular component.load() is invoked, please take a look at the
p-button.<p-button>Hello</p-button>
p-button tag in the DOM. From here on the exact same things happen as described at
Important
p-button renders again and synchronizes its properties to the rendered p-button
element. What follows is, again, exactly as documented at
p-button is not needed anymore, e.g. when conditionally rendered or navigating away, the p-button
element is removed from the DOM. What happens additionally can be found at
p-button is rendered, let's see how this looks
from the perspective of network requests and how to improve them if necessary.index.htmlruntime.js, polyfills.js and main.js bundle of the Angular appregular and semi-bold weights are preloaded since they are most commonly used but this can be customized.font-family and that particular font-weight
which can lead to a phenomena called Flash of Unstyled Text (FOUT).getComponentChunkLinks({ components: ['button'] });
Hint
Conclusion
getLoaderScript() partial is pointless since there is no benefit because everything Porsche Design
System related is loaded before or at the same time as the Angular app itself. Therefore, the DOM is empty once the
preloaded chunks are available.