
上QQ阅读APP看书,第一时间看更新
Getting started
In order to use Angular forms in our Workout component, we must first add some additional configuration. Open workout-buider.module.ts from the workout-builder folder under trainer/src/app in checkpoint 4.5. You will see that it imports FormsModule:
....
import { FormsModule } from '@angular/forms';
....
@NgModule({ imports: [ CommonModule, FormsModule, SharedModule, workoutBuilderRouting ],
This brings in all that we will need to implement our form, including:
- NgForm
- ngModel
Let's start using these to build our form.