Dealing with the ahead-of-time compiler's limitations
The upside of using Angular Ivy's ahead-of-time compiler is faster runtime speed and a smaller bundle because of not having to ship a compiler to the runtime bundle or compiler before rendering the application.
When using the ahead-of-time compiler, there is a trade-off to be aware of. Declarables—that is, directives, components, and pipes—cannot rely on runtime information because they must be compiled ahead of time, that is, at build time rather than at runtime.
This sets a limitation for dynamically creating declarables at runtime, for example, based on server-side configuration or a static configuration file. Unless, of course, we bundle the Angular compiler with our application and use it at runtime, but then what would be the point?
The good news is that injected dependencies—that is, class-based services, provided values, or functions—can be resolved at runtime. Keep in mind...