Generating your first Angular component

For those who haven't had much experience with Angular, a component is basically a Lego brick for the UI. Your web application can be divided into multiple components. Each component has the following files:

  • COMPONENT_NAME.component.ts: The component-logic definition written in TypeScript
  • COMPONENT_NAME.component.html: The HTML code of the component
  • COMPONENT_NAME.component.css: The CSS structure of the component
  • COMPONENT_NAME.component.spec.tsThe unit test of the component class

In our example, we will need at least three components:

  • The Navigation Bar component
  • The List of Movies component
  • The Movie component

Before we create our first component, let's install Bootstrap, which is a frontend ...

Get Hands-On Serverless Applications with Go now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.