Book Image

Server-Side Enterprise Development with Angular

By : Bram Borggreve
Book Image

Server-Side Enterprise Development with Angular

By: Bram Borggreve

Overview of this book

With the help of Server-Side Enterprise Development with Angular, equip yourself with the skills required to create modern, progressive web applications that load quickly and efficiently. This fast-paced book is a great way to learn how to build an effective UX by using the new features of Angular 7 beta, without wasting efforts in searching for referrals. To start off, you'll install Angular CLI and set up a working environment, followed by learning to distinguish between the container and presentational components. You'll explore advanced concepts such as making requests to a REST API from an Angular application, creating a web server using Node.js and Express, and adding dynamic metadata. You'll also understand how to implement and configure a service worker using Angular PWA and deploy the server-side rendered app to the cloud. By the end of this book, you'll have developed skills to serve your users views that load instantly, while reaping all the SEO benefits of improved page indexing.
Table of Contents (5 chapters)

Installing Angular CLI

Angular CLI is the officially supported tool for creating and developing Angular applications. It's an open source project that is maintained by the Angular team and is the recommended way to develop Angular applications.

Angular CLI offers the following functionalities:

  • Create a new application
  • Run the application in development mode
  • Generate code using the best practices from the Angular team
  • Run unit tests and end-to-end tests.
  • Create a production-ready build
  • Easily install and add third-party software (using ng add, since version 6)

One of the main benefits of using Angular CLI is that you don't need to configure any build tools. It's all abstracted away and available through one handy command: ng.

Throughout this book, we will be using the ng command for creating the app, generating the code, running the application in development mode, and creating builds.

Note

For more information about Angular CLI, refer to the project page on GitHub at https://github.com/angular/angular-cli.

Exercise 1: Installing Angular CLI

In this exercise, we will use npm to globally install Angular CLI. This will give us access to the ng command, which we will use throughout this book:

  1. Open your terminal.
  2. Run the following command:
    npm install -g @angular/cli@latest
  3. Once this command has finished running without any errors, we can make sure that the ng command works as expected by running the following command:
    ng --version

    Verify that the output is similar to the output shown here:

Figure 1.1: Installing Angular CLI
Figure 1.1: Installing Angular CLI

We now have Angular CLI installed and we are ready to get started!