Skip to content

Commit 62d0728

Browse files
committed
fix(@schematics/angular): generate application with projectRoot is provided
1 parent 53684fe commit 62d0728

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

docs/documentation/generate/application.md

+9
Original file line numberDiff line numberDiff line change
@@ -96,3 +96,12 @@ Create an Angular application.
9696
Do not add dependencies to package.json.
9797
</p>
9898
</details>
99+
<details>
100+
<summary>project-root</summary>
101+
<p>
102+
<code>--project-root</code>
103+
</p>
104+
<p>
105+
Specify root folder for new application and e2e tests
106+
</p>
107+
</details>

docs/documentation/stories/multiple-projects.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ To create another app you can use the following command:
77
ng generate application my-other-app
88
```
99

10-
The new application will be generated inside `projects/my-other-app`.
10+
The new application will be generated inside `projects/my-other-app`. If you wish to override root folder specify `--project-root applicationPath`
1111

1212
Now we can `serve`, `build` etc. both the apps by passing the project name with the commands:
1313

packages/schematics/angular/application/index.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -270,10 +270,8 @@ export default function (options: ApplicationOptions): Rule {
270270
name: `${options.name}-e2e`,
271271
relatedAppName: options.name,
272272
rootSelector: appRootSelector,
273+
projectRoot: `${newProjectRoot}/e2e`,
273274
};
274-
if (options.projectRoot !== undefined) {
275-
e2eOptions.projectRoot = 'e2e';
276-
}
277275

278276
return chain([
279277
addAppToWorkspaceFile(options, workspace),

0 commit comments

Comments
 (0)