Découpage en 1 service par composant
This commit is contained in:
@@ -2,7 +2,7 @@ import { Component, OnInit } from '@angular/core';
|
||||
import { FormControl, FormGroup, Validators } from '@angular/forms';
|
||||
|
||||
import { ServiceComm } from '../../services/service-comm.service';
|
||||
import { ServiceApiPost } from '../../services/service-api-post.service';
|
||||
import { GearService } from '../../services/gear.service';
|
||||
import { AddAction } from '../../models/add-action.enum';
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ import { AddAction } from '../../models/add-action.enum';
|
||||
export class NewGearComponent implements OnInit {
|
||||
public addForm: FormGroup;
|
||||
|
||||
constructor(private serviceComm: ServiceComm, private servicePost: ServiceApiPost) {
|
||||
constructor(private serviceComm: ServiceComm, private serviceApi: GearService) {
|
||||
this.addForm = new FormGroup({
|
||||
name: new FormControl('', Validators.required),
|
||||
manufacturer: new FormControl('', Validators.required),
|
||||
@@ -30,7 +30,7 @@ export class NewGearComponent implements OnInit {
|
||||
}
|
||||
|
||||
onSubmit(formData) {
|
||||
this.servicePost.AddGear(
|
||||
this.serviceApi.AddGear(
|
||||
formData.value.name,
|
||||
formData.value.manufacturer,
|
||||
formData.value.minSize,
|
||||
|
||||
Reference in New Issue
Block a user