From the course: Angular: Building an Interface

Working with the Angular CLI - Angular Tutorial

From the course: Angular: Building an Interface

Start my 1-month free trial

Working with the Angular CLI

- [Instructor] To get this application started, I'm going to show you how to work with something called the Angular CLI. The Angular CLI or command line interface, makes it easier to create angular applications by automating some of the steps required. You can get the CLI at this URL. Now the CLI does require that you have Node.js installed, which you can also get at this URL. When you install node, it includes something called the Node Package Manager, for managing extensions that you add to your applications. In this course, we're also going to use Git and GitHub, which you can get at this URL. Now Git and GitHub will help you manage your web projects. You should be familiar with working with both of those. I also recommend that when you install Git, you also install the Git BASH tool, if you're on a PC. That's so that it will help write Linux type commands, which I'll be using in this course. Now thankfully we have some great courses in the library that can help you if you need more information about NPM, Git, and GitHub. Now the three main commands that you use when working with the CLI are ng new, which creates a new application, ng serve, which creates a temporary environment that automatically reloads files when you make changes to an application during testing, and ng build, which creates a distribution folder that you can use to upload to a server when the application is ready. To install the Angular CLI, I'm going to go to my terminal application, I'm on a Mac and I'm using an application called Hyper, which is pretty cool, and you can get at this URL. Then you can also use the Mac terminal, and if you're in a PC you should be using the Git BASH terminal. So to install this, I'm going to use npm and issue the install command, install this globally, and I'm going to look for something called angular/cli. Right, now that the Angular CLI is installed, I'm going to need to go to a directory on my hard drive. I'm going to place things on the desktop. So I'm going to issue a cd ~/Desktop command, and then I'm going to run the ng new command, and specify a name for my application. I'll call mine angular interface. Now when you do this, it's going to ask you a few questions. Would you like to add angular routing? Angular routing is a more advanced feature that we won't be using in this course, so I'm going to hit the N key for no. You can also use the CLI with different CSS extension languages, like SASS if you want to. We're just going to be working with CSS so I'll hit return. The Angular CLI is going to save you a lot of time when creating projects. In the next video, we'll take a peak into all the stuff that Angular and the CLI has created for you.

Contents