Angular CLI − ng doc Command



This chapter discusses the Angular CLI command ng doc, including introduction, its syntax, arguments, and options.

The 'ng doc' Command

The Angular CLI provided a command called "ng doc", which is used to open the official Angular documentation in a browser and search for a given keyword.

Important! The latest version of the Angular CLI no longer supports the "ng doc" command. Instead, it is recommended to use the ng help command.

Syntax

Following is the syntax of the Angular CLI ng doc command −

ng doc  [options]

Here,

  • keyword:

Arguments

The arguments for ng doc command is as follows −

Sr.No. Argument & Description
1

The keyword to search for, as provided in the search bar in angular.io.

Options

Options are optional parameters. A few commonly used options are listed below:

Sr.No. Option & Description
1 --help=true|false|json|JSON

Shows a help message for this command in the console.

2 --search

Search all of angular.io. Otherwise, searches only API reference documentation.

Aliases: -s

Default value: false

3 --version

The version of Angular to use for the documentation.

Example

An example for ng doc command is given below −

ng doc

As this command is no longer supported by the latest version of Angular CLI, it will throw the following error:

Error: Unknown argument: doc
Advertisements