Angular

Angular CLI Basics - ng new

Outline

ng new is likely the first command you'll use for each new Angular application created using the CLI. It creates a new application for you, and allows you to skip the manual setup that would otherwise be needed.

There are many flags that can be used with ng new, and you can see a full list of those here in the Angular CLI docs. The ones that we cover in this video are:

  • --dryRun, or -d: Allows you to run a command to see what the output would be, but doesn't actually execute the command
  • --routing: Generates a routing module for the application
  • --style: Sets the default stylesheet format for the application. The default if CSS, but you can also use Sass, SCSS, Less, or Stylus
  • --prefix: Sets a default prefix for components and directives. The default is app, but you can change that globally here. You can also change it on a per module or per component/directive basis if you'd like
  • --skip-git, or -g: Skips the git repo creation, which is useful if you're creating an application inside a previously created repository
  • --skip-install: Skips the npm install step, so NPM packages won't be added automatically

You can see all the docs on ng new right here.

 

I finished! On to the next chapter