export async function ngAspnetCoreEngine()

in modules/aspnetcore-engine/src/main.ts [64:90]


export async function ngAspnetCoreEngine(
  options: Readonly<IEngineOptions>,
): Promise<IEngineRenderResult> {
  if (!options.appSelector) {
    const selector = `" appSelector: '<app-root></app-root>' "`;
    throw new Error(`appSelector is required! Pass in ${selector},
     for your root App component.`);
  }

  const renderOptions: RenderOptions = {
    url: options.url || options.request.absoluteUrl,
    document: options.document || options.appSelector,
    providers: [
      ...(options.providers || []),
      getReqResProviders(options.request.origin, options.request.data.request),
    ],
    bootstrap: options.ngModule,
    inlineCriticalCss: options.inlineCriticalCss,
    publicPath: options.publicPath,
  };

  // Grab the DOM "selector" from the passed in Template <app-root> for example = "app-root"
  const appSelector = options.appSelector.substring(1, options.appSelector.indexOf('>'));
  const html = await commonEngine.render(renderOptions);

  return _getUniversalData(html, appSelector);
}