1 min readMar 14, 2017
Hi,
Regarding my previous response, I figured out (or rather found) a way to do it and still use AoT and not include JitCompiler.
What you can do is use ComponentFactoryResolver
and just call factory.create
on some element. It does have some limitations (Inputs will not work — u have to get them from element manually for example), but its good enough, and better that just using plain DOM api to hook up functionality.
Here is an example: https://github.com/angular/angular/blob/master/aio/src/app/layout/doc-viewer/doc-viewer.component.ts
I made it more generic for my case. Maybe you can add it as #7.