If I use AOT compilation dynamic compilation will not possible. So I need to load the compiler to a browser. So how do I load it? If I use
import { JitCompilerFactory } from '@angular/compiler';
However, after importing the JitCompilerFactory
I am getting the following error:
"export 'JitCompilerFactory' was not found in 'angular/compiler
So am I right that now I need to import it from 'angular/platform-browser-dynamic'
for dynamic compilation?
You need to import
JitCompilerFactory
into your app.module.ts like this:Here I created a fully working StackBlitz Demo with a Dynamic Component if you want to play around with it on there.