[Angular2 Form] Reactive Form, FormBuilder
Import module: import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; import { MessageComponent } from './message.component'; import messageRoutes from './message.routes'; import {FormsModule, ReactiveFormsModule} from "@angular/forms"; @NgModule({ imports: [ CommonModule, FormsModule, ReactiveFormsModule, messageRoutes ], declarations: [MessageComponent] }) export default class MessageModule { } Define the html: <form [formGroup]="reactiveForm" novalidate autocomplete="off"> <div class="form-field"> <label>Title:</label> <input formControlName="title"> </div