runAppLegacyAsync<T extends Object> function
Starts a new AngularDart application with componentType
as the root.
This is the runAppLegacy variant of the runAppAsync function.
Implementation
Future<ComponentRef<T>> runAppLegacyAsync<T extends Object>(
Type componentType, {
required Future<void> Function(Injector) beforeComponentCreated,
List<Object> createInjectorFromProviders = const [],
void Function()? initReflector,
}) {
assert(T == Object || T == componentType, 'Expected $componentType == $T');
if (initReflector != null) {
initReflector();
}
return runAppAsync(
unsafeCast(typeToFactory(componentType)),
beforeComponentCreated: beforeComponentCreated,
createInjector: (parent) {
return ReflectiveInjector.resolveAndCreate(
[
createInjectorFromProviders,
],
unsafeCast(parent),
);
},
);
}