Hello, what is the best option to migrate NgModule with constructor(), to standalone? For example how to rewrite the following code to standalone?
@NgModule({
imports: [
// ...
MatIconModule
]
})
export class AppModule {
constructor(matIconRegistry: MatIconRegistry, domSanitizer: DomSanitizer){
matIconRegistry.addSvgIconSet(
domSanitizer.bypassSecurityTrustResourceUrl('./assets/mdi.svg')
);
}
}
I see two options:
- Use
APP_INITIALIZER(possible app start slowdown). - Move this code to root component constructor.
But what will be preferred?