Skip to content

.angular cli.json

Ferdinand Malcher edited this page May 11, 2017 · 4 revisions

Add an .angular-cli.json file at the root of your project that configures angular-cli to generate components/services/etc. in the correct places.

{
  "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
  "project": {
    "name": "AngularBasicTemplate"
  },
  "apps": [
    {
      "root": "ClientApp",
      "prefix": "br"
    }
  ],
  "test": {
    "karma": {
      "config": "./ClientApp/test/karma.conf.js"
    }
  },
  "defaults": {
    "styleExt": "css",
    "component": {}
  }
}

Then run npm i --save-dev @angular/cli. Now we can use at least the code-geration feature of the CLI. In example, this adds a new component:

ng g c test

Clone this wiki locally