import { Injector , Type } from '@angular/core' ; import { platformDynamicServer } from '@angular/platform-server' ; export async function getInjector < M > ( moduleType ) { const appRef = await platformDynamicServer ( ) . bootstrapModule ( moduleType ) ; return appRef . injector ; }