Can I or can I not use Angular 2 with AOT for this project? It is important that it is AOT, it can’t be JIT.
I building an app with a lot of different components, in runtime I will get a specification on which components should be shown. Sometimes 1 components will be shown and sometimes up to 30.
I would like to have these components in a different file. Not just a different .ts-file, i would like to have these components in different .js files and store them on or server and get them when necessary.
For three reasons:
The user shouldn’t have to update the app if just one component is updated.
If an update is made on one component i don’t want anything else in the app to break just because of this. (and yes it does). If a new app is built we have to retest the whole app, not just that one component.
- If only 1 component is needed it is unnecessary to load all 30.
So i’ve been on google/here on stack overflow and searched this and tried different solutions, but no one seems the have this issue. All examples that I found already have the component in the app and its been declared in the NgModule. But my component doesn’t exist until I get the file from the server.