The form module

Now that we have a contract that we want the form to follow, let's now generate the form's component:

ng  g component flight-form

The command also adds the component as a declaration to our App module:

import { BrowserModule } from '@angular/platform-browser';import { NgModule } from '@angular/core';import { AppComponent } from './app.component';import { FlightFormComponent } from './flight-form/flight-form.component';@NgModule({  declarations: [    AppComponent,    // Component added after    // being generated    FlightFormComponent  ],  imports: [    BrowserModule  ],  providers: [],  bootstrap: [AppComponent]})export class AppModule { }

What makes Angular forms special and easy to use are functionalities provided out-of-the-box, such as the ...

Get TypeScript 2.x for Angular Developers now with O’Reilly online learning.

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