в общем проблема у меня такая
кто может мне помочь с этим ?
присоеденяю код к топику
компонент формы
import { Component, OnInit } from '@angular/core';
import {NgbModal} from '@ng-bootstrap/ng-bootstrap';
import { MovieRequestService } from '../../shared/services/movie-request.service';
import { HttpClient} from '@angular/common/http';
import {ActivatedRoute, Router} from '@angular/router';
import { FlashMessagesService } from 'angular2-flash-messages';
@Component({
selector: 'app-edit-movie-modal',
templateUrl: './edit-movie-modal.component.html',
styleUrls: ['./edit-movie-modal.component.css']
})
export class EditMovieModalComponent implements OnInit {
closeResult: string;
movie: any = new Object();
id: number;
constructor(
private modalService: NgbModal,
private movieService: MovieRequestService,
private flashMessage: FlashMessagesService,
private http: HttpClient,
private router: Router,
private route: ActivatedRoute
) {
this.getMovieDetails();
}
openBackDropCustomClass(content) {
this.modalService.open(content, {backdropClass: 'light-blue-backdrop'});
}
ngOnInit() {
}
getMovieDetails () {
// Get Id from URL
this.id = this.route.snapshot.params['id'];
this.movieService.getMovieDetails(this.id).subscribe(response => this.movie = response.data.movie);
}
onDelete () {
if (confirm('Are you sure ???')) {
this.movieService.deleteMovie(this.movie);
this.flashMessage.show('Movie Removed Succes');
}
}
onSave () {}
}
ХТМЛ страницы
<ng-template #content let-modal>
<div class="modal-header">
<h4 class="modal-title">Edit Movie</h4>
<button type="button" class="close" aria-label="Close" (click)="modal.dismiss('Cross click')">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<form #editMovieForm="ngForm" (ngSubmit)="onSave(editMovieForm)">
<div class="form-group">
<label for="title">Movie Title</label>
<input
type="text"
name="title"
id="title"
class="form-control"
[(ngModel)]="movie.title"
>
</div>
<div class="form-group">
<label for="year">Year</label>
<input
type="text"
name="year"
id="year"
class="form-control"
[(ngModel)]="movie.year"
>
</div>
<div class="form-group">
<label for="runTime">Run Time</label>
<input
type="text"
name="runTime"
id="runTime"
class="form-control"
[(ngModel)]="movie.runtime"
>
</div>
<div class="form-group">
<label for="genre">Genre</label>
<input
type="text"
name="genre"
id="genre"
class="form-control"
[(ngModel)]="movie.genres"
value=""
>
</div>
<div class="form-group">
<label for="cast">Cast</label>
<input
type="text"
name="cast"
id="cast"
class="form-control"
[(ngModel)]="movie.cast"
>
</div>
<div class="form-group">
<label for="description">Description</label>
<textarea
class="form-control"
id="description"
name="description"
[(ngModel)]="movie.description_full"
></textarea>
</div>
<input type="submit" class="btn btn-success" value="Save">
<button
type="button"
class="btn btn-danger float-right"
(click)="onDelete()"
><i class="far fa-trash-alt"></i> Remove</button>
</form>
</div>
</ng-template>
<button class="btn btn-light mb-2 mr-2" (click)="openBackDropCustomClass(content)">Edit Movie</button>
помогите плиз очень супер важно найти решение