Angular CLI - ng config Command


Advertisements

This chapter explains the syntax, arguments and options of ng config command along with an example.

Syntax

The syntax for ng config command is as follows −

ng config <jsonPath> <value> [options]

ng config command retrieves or sets angular configuration values in angular.json.

Arguments

The arguments for ng config command is as follows −

Sr.No. Argument & Syntax Description
1 <jsonPath> The configuration key to set or query, in JSON path format. For example: "a[3].foo.bar[2]". If no new value is provided, returns the current value of this key.
2 <value> If provided, a new value for the given configuration key.

Options

Options are optional parameters.

Sr.No. Option & Syntax Description
1 --global=true|false

When true, accesses the global configuration in the caller's home directory.

Default: false

Aliases: -g

2 --help=true|false|json|JSON

Shows a help message for this command in the console.

Default: false

First move to an angular project updated using ng build command.This chapter is available at https://www.tutorialspoint.com/angular_cli/angular_cli_ng_build.htm.

Now run the config command.

Example

An example for ng config command is given below −

\>Node\>TutorialsPoint> ng config projects.TutorialsPoint.projectType
application
Advertisements