coreLoadAndBootstrap function

Future<ComponentRef> coreLoadAndBootstrap (Injector injector, Type componentType)

Resolves the componentFactory for the given component, waits for asynchronous initializers and bootstraps the component.

Requires a platform the be created first.

Implementation

Future<ComponentRef> coreLoadAndBootstrap(
    Injector injector, Type componentType) async {
  appViewUtils = injector.get(AppViewUtils);
  ApplicationRef appRef = injector.get(ApplicationRef);
  return await appRef.run(() async {
    ComponentResolver componentResolver = injector.get(ComponentResolver);
    ComponentFactory factory =
        await componentResolver.resolveComponent(componentType);
    await appRef.waitForAsyncInitializers();
    return appRef.bootstrap(factory);
  });
}