In this video Victor Mejia talks about the official Angular CLI. Learn how to install it, and how to use the different CLI commands.
- [Instructor] In this course, we will be using the official Angular CLI. The CLI is developed by the Angular team and makes it easy for you to spin up a new Angular project, generate components, services, and even set up a live development server and it build pipe on for you. You will need to globally install the CLI InterSystem. I'm on a Mac here, so I'm going to head over and use the terminal application, if you're on a windows machine use the install command prompt. You will probably need to run it as an elevated prompt by right clicking it and then selecting Run as Administrator.
You then install the CLI by running NPM install globally Angular CLI. This will go ahead and fetch some necessary dependencies from NPM, in order to install the tool globally on your machine. This will take a few moments, we'll speed it up for the demo. Now once that is installed, to create a new Angular project, run NG new demo-app.
This was scaffold a new project for you and start installing dependencies generating a package.json, configuration files for typescript, testing, and for running and building the application. Along with the first sample component. Once that completes, we can go ahead in CD into that directory. Once in that directory, running NG serve will run the development build of your app, and running development server at 4200 watching and rebuilding when any changes are made to your code.
Let's go ahead and kill this using controls. Running NG build with the dash dash prod flag, will run a production build of your app, and place them in the DIS folder. Producing optimized bundles. And an index.html page referencing those bundles. The app you'll be working with was generated with a routing module. And also using sass for a CSS. To do so, you can run NG new contact-manager and use a couple of flags here.
The first flag will be the style flag. And we want to use sass. The second flag will specify that we want to use routing in this application. The app you'll be working with was generated using these configurations. In the next video, we'll see how to architect in application using Angular and Node.
- Setting up and seeding your database
- Using HTTP requests and routing in Angular
- Creating an Angular service
- Adding JWT authentication
- Implementing a user login
- Sending JWTs to API requests