Two-way Data Binding with ngModel
A very convenient process when creating or updating the model of your Angular application through forms is Two-way Data Binding with ngModel
. In the previous application, we had the following submit()
method:
private submit(){ console.log( "Form Values", this.movieForm.value.movie_id, this.movieForm.value.title, this.movieForm.value.phase, this.movieForm.value.category_name, this.movieForm.value.release_year, this.movieForm.value.running_time, this.movieForm.value.rating_name, this.movieForm.value.disc_format_name, this.movieForm.value.number_discs, this.movieForm.value.viewing_format_name, this.movieForm.value.aspect_ratio_name, this.movieForm.value.status, this.movieForm.value.release_date, this.movieForm.value.budget, this.movieForm.value.gross, this.movieForm.value.time_stamp ); if(this.movieForm.valid){ let movie:Movie = new Movie( this.movieForm.value.movie_id, ...