Découpage en 1 service par composant
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { FormControl, FormGroup, Validators } from '@angular/forms';
|
||||
import { ServiceApiPost } from '../../services/service-api-post.service';
|
||||
import { AircraftService } from '../../services/aircraft.service';
|
||||
import { ServiceComm } from '../../services/service-comm.service';
|
||||
import { AddAction } from '../../models/add-action.enum';
|
||||
|
||||
@@ -14,7 +14,7 @@ export class NewAircraftComponent implements OnInit {
|
||||
public addForm: FormGroup;
|
||||
|
||||
constructor(private serviceComm: ServiceComm,
|
||||
private serviceApiPost: ServiceApiPost) {
|
||||
private serviceApi: AircraftService) {
|
||||
this.addForm = new FormGroup({
|
||||
aircraftName: new FormControl('', Validators.required)
|
||||
});
|
||||
@@ -24,7 +24,7 @@ export class NewAircraftComponent implements OnInit {
|
||||
}
|
||||
|
||||
onSubmit(formData) {
|
||||
this.serviceApiPost.AddAircraft(formData.value.aircraftName);
|
||||
this.serviceApi.AddAircraft(formData.value.aircraftName);
|
||||
this.serviceComm.RefreshData(AddAction.Aircraft);
|
||||
|
||||
this.addForm.reset();
|
||||
|
||||
Reference in New Issue
Block a user