-
Notifications
You must be signed in to change notification settings - Fork 34
Angular 4.0.3 #19
Comments
Thank you for reporting. unfortunately, I have the same situation, too. I tried to use DynamicComponentModule w/ Angular CLI, but I can't enable |
@laco0416 any progress? thanks. |
Try using --no-aot flag for production: |
With --no-aot, it works but not a real solution. |
@laco0416 any progress on this yet? Thanks in advance! |
I'm sorry. I don't have any ideas. |
@laco0416 does this article help with this at all? https://hackernoon.com/here-is-what-you-need-to-know-about-dynamic-components-in-angular-ac1e96167f9e#3c5c |
Hey, guys! I was able to use DynamicComponentModule with aot build. I don't know if i am missing something, but it went without any complications. I made a repo, check it out. I also deployed to github, built with |
@bgolyoo Your project imports CommonModule in DynamicComponentModule.forRoot(). What if it imports a custom module that implements some components needed by the dynamic HTML? In my case, that's when the AOT build fails at runtime with the following error message:
When I modified my project to import CommonModule instead of the custom module, the AOT build works and no run-time error either, but obviously none of my custom components render in that case. |
@maychan111 Yes, you are right! Upon further inspection I noticed it too. |
@maychan111 It sounds like we have the same situation. This would be amazing to find a fix for. |
Hello, I'm using the DynamicComponentModule
It works fine in dev mode but it doesn't work in prod mode (--prod).
I get the error in the browser console :
ERROR Error: Unexpected value 't' imported by the module 't'. Please add a @NgModule annotation.
Here is how i bootstrap the app: (i'm using compiler providers)
I have a module that contains some components
And i'm using it in another module
The text was updated successfully, but these errors were encountered: