ng2-dynamic-content
ng2-dynamic-content copied to clipboard
Runtime compiler is not loaded
Hi,
When browsing an application (based on angular-cli) compiled for production in Angular 4.0.3:
ng build --env=prod -prod
a runtime error happens when loading a dynamic component (RuntimeContentComponent):
Error: Runtime compiler is not loaded
The same happens when AOT is disabled:
ng build --env=prod -prod -no-aot --aot=false
@zarpilla just verified what declaring a constructor
in RuntimeContentComponent
class, with compiler
as parameter, it comes by injection:
...
export class RuntimeContentComponent {
private componentRef: ComponentRef <{}>;
constructor(private compiler: Compiler) {}
...
}
This works with aot=false but fails with aot. Any suggestion to get this working with AOT? Thanks.