Forrest logo
tool overview
On this page you find all important commands for the CLI tool ng. If the command you are looking for is missing please ask our AI.

ng

The command line tool "ng" stands for Angular CLI, which is a powerful development tool for creating and managing Angular applications.

  1. "ng" provides a wide range of commands and options to scaffold, build, test, and deploy Angular applications.
  2. It simplifies the development process by automating many common tasks and providing a consistent project structure.
  3. Angular CLI uses the "ng" command followed by specific options and arguments to execute various tasks.
  4. It can create a new Angular project with a basic setup by using the "ng new" command.
  5. "ng serve" starts a local development server and compiles the application, enabling live reloading for faster development iterations.
  6. "ng generate" or "ng g" helps create new components, services, modules, or other Angular artifacts using predefined blueprints.
  7. "ng build" creates a production-ready build of the application for deployment, optimizing the code for better performance.
  8. "ng test" runs the unit tests included in the project, powered by frameworks like Karma and Jasmine.
  9. "ng lint" analyzes the codebase, checking for coding style issues and potential errors according to defined linting rules.
  10. Angular CLI integrates with modern tools like Webpack for module bundling and provides a seamless development experience for Angular developers.

List of commands for ng:

  • ng:tldr:06eaa ng: Check the version of your current Angular installation.
    $ ng version
    try on your machine
    explain this command
  • ng:tldr:17ccc ng: Create a new Angular application inside a directory.
    $ ng new ${project_name}
    try on your machine
    explain this command
  • ng:tldr:31e0f ng: Run the application with the following command in its root directory.
    $ ng serve
    try on your machine
    explain this command
  • ng:tldr:45d5d ng: Run unit tests.
    $ ng test
    try on your machine
    explain this command
  • ng:tldr:613dd ng: Add a new component to one's application.
    $ ng generate component ${component_name}
    try on your machine
    explain this command
  • ng:tldr:a84b5 ng: Build the application.
    $ ng build
    try on your machine
    explain this command
  • ng:tldr:aa76f ng: Add a new directive to one's application.
    $ ng generate directive ${directive_name}
    try on your machine
    explain this command
  • ng:tldr:e490a ng: Add a new class to one's application.
    $ ng generate class ${class_name}
    try on your machine
    explain this command
tool overview