I have a random markups from back-end that should be compiled in runtime with JiT. Every component used in this markups is already pre-compiled with AoT (added to entryComponents block) and so has component factory in runtime. When JiT compiles provided markup it ignores existing components factories and re-compile every inner component.
Is there any way to provide component's AoT pre-compiled factories to JiT compilator to compile only one dynamic component with dynamic template?
Markup that should be compilated looks like this
<exercise1 smth="smth">
<exercise1-answer>smth</exercise1-answer>
</exercise1>
<some-wrapper-cmp>
<exercise2 smth="smth">
<exercise2-answer>smth</exercise2-answer>
</exercise2>
</some-wrapper-cmp>
with arbitrary nesting (regular markup can contains 1500-2000 DOM nodes)
p.s. i'm using this way to get JiT with AoT https://github.com/angular/angular/issues/15510#issuecomment-294301758 and then just
const component = Component({ template })(class {});
const module = NgModule({ imports, declarations: [ component ], schemas })(class {});
this.compiler.compileModuleAndAllComponentsAsync(module)
.then(factories => factories.componentFactories.filter(factory => factory.componentType === component)[0])
.then(componentFactory => {
this.componentRef = this.viewContainerRef.createComponent(
componentFactory,
null,
this.viewContainerRef.injector
);
this.compilationEnd.emit();
});`enter code here`