Example #1
0
export function createChildInjector(
  parent: ReflectiveInjector,
  { ngModule, providers }: ModuleWithProviders
): ReflectiveInjector {
  const injector = parent.resolveAndCreateChild([
    ...(providers || []),
    ngModule,
  ]);

  injector.get(ngModule);

  return injector;
}