Adding Angular application to an existing project

Using ng new is still the easiest way to achieve this.

  1. Create an angular project using ng new.

  2. Move everything in the src folder to src/client

  3. Adjust the root property in angular-cli.json (or angular.json) to src/client, also if you care about linting, adjust the linting property.

  4. Set the extends property in tsconfig.app.json and tsconfig.spec.json to "extends": "../../tsconfig.json"

  5. Test serving, building, testing and linting commands. They should work fine.

  6. Copy the content from the server folder and add of its dependencies to package.json


The answer of @Austin752 seems to be outdated. According to the documentation the command to add an angular application to an existing project is (Angular CLI version 8.3.23):

$ ng generate application <name> [options]

Or

$ ng g application <name> [options]

see: https://angular.io/cli/generate#application-command

This will add the new app in the projects folder in the root of your workspace


There's a parameter --directory, at least in the latest version of Angular.

So now you just run

ng new <app-name> --directory <dir-name>