Angular 4 is a powerful JavaScript framework for building web applications. The Angular CLI makes it easy to create, build and test Angular applications. However, one of the challenges of using Angular is that it is not easy to optimize applications for search engine optimization (SEO). In this tutorial, we will show you how to use the Angular CLI and Universal to create an SEO-friendly Angular 4 application.
The first step is to install the Angular CLI. If you do not already have the Angular CLI installed, you can install it using npm:
npm install -g @angular/cli
Once the Angular CLI is installed, you can create a new project using the ng command:
ng new my-project
Once the project is created, you can enter the project directory and serve the application:
cd my-project ng serve –open
The application will be open in your browser at http://localhost:4200/. You should see the default Angular welcome page.
Creating a Universal Build for SEO