-
Notifications
You must be signed in to change notification settings - Fork 12k
ng generate doesn't work with multiple apps #7418
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I think the value for --app is supposed to be the index of the app cofig not the name. So --app=1 |
Using index of app in --app option created a module with the right selector in case of component but all files are gerenerated to wrong directory. |
+1 How can I use generate command to do the following?
I've tried exec from the directory where I want the module to be generated too, and it still creates the module in the wrong location. e,g, /src/app
Am I missing a config setting? See my app definitions below.
|
The app folder is a hardcoded string and can not be changed. You need to change the root folder from "src" to "src/foobar". The path for the "application files" for that app will then be "src/foobar/app". |
@grizzm0 so, if it is hardcoded, it means error? because as i understand --app is exactly made for the purpose of defining the place of the app |
Each app in the apps array in .angular-cli.json has the structure you see inside "src" in a new project. If you want to create a new app you need to move the entire content of ./src to ./src/app-name and change the apps.0.root key from "src" to "src/app-name". The new structure would be
There's currently an issue with sharing code between different apps in AOT. See #7309 for more info. |
I have the same problem. 2 applications (but both have different source directories - |
The reason for this is that hard coded
What is the reason for forcing everything into #showstopper |
If I understand this correctly, the CLI is using the app at index 0 to set the generate path and not adjusting when setting the --app flag. I got a workaround working by setting a dummy app as the first app in the array and only giving that app the root property.
It seems that the "root" property is all it needs to work. Then with this setup, I just enter the app folder I need as part of the module name in the generate command for the new item. This seems to put it in the right place.
|
using 1.5.0-beta.3, setting "root": "src/extra-app" will disallow a compiler to use other (i.e. shared) sources, usually located in src/. also I can't manually select a module path+filename, it always produces error "Error: Could not find an NgModule" |
This should be handled via PR #7775. |
I do not see a fix for this issue, how do i add components using cli in my multi-app project |
In |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
I have defined two applications in angular-cli.json with names
app
(default) andspa
. When I generate any part of app (component, class, etc.), it is always generated to default application folder/app
.I tried to use option
--app spa
, it's ignored and files are generated to/app
folder.Any way how to fix that?
angular-cli.json
Versions.
The text was updated successfully, but these errors were encountered: