How to do it...

Let's follow the steps below to learn how to read and write from our Angular application's configuration file using Angular-CLI:

  1. To get the name of an Angular-CLI application, we would use:
ng get
  1. You can see how the value maps to the content of our .angular-cli.json file:
{    ...    "project": {     "name": "my-angular4-project"    },    ... }
  1. We can also write to this configuration file using the set command:
ng set
Note that any configuration changes here will not be picked up by live reload, and will require an entire restart of your Angular-CLI web server to be picked up by your application.

Get MEAN Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.