Import "TranslateModule"

This commit is contained in:
2026-01-14 10:56:01 +01:00
parent 7a667f10c3
commit c4cc91bb06
23 changed files with 653 additions and 569 deletions

View File

@@ -4,19 +4,21 @@ import { FormControl, FormGroup, Validators } from "@angular/forms";
import { ServiceComm } from "../../services/service-comm.service";
import { GearService } from "../../services/gear.service";
import { AddAction } from "../../models/add-action.enum";
import { TranslateModule } from "@ngx-translate/core";
@Component({
selector: "app-new-gear",
templateUrl: "./new-gear.component.html",
styleUrls: ["./new-gear.component.css"],
standalone: false
selector: "app-new-gear",
templateUrl: "./new-gear.component.html",
styleUrls: ["./new-gear.component.css"],
imports: [TranslateModule],
})
export class NewGearComponent implements OnInit {
public addForm: FormGroup;
constructor(private serviceComm: ServiceComm,
private serviceApi: GearService)
{
constructor(
private serviceComm: ServiceComm,
private serviceApi: GearService
) {
this.addForm = new FormGroup(
{
name: new FormControl("", Validators.required),
@@ -24,41 +26,44 @@ export class NewGearComponent implements OnInit {
minSize: new FormControl("", [
Validators.required,
Validators.min(60),
Validators.max(320)
Validators.max(320),
]),
maxSize: new FormControl("", [
Validators.required,
Validators.min(60),
Validators.max(320)
Validators.max(320),
]),
aad: new FormControl("", Validators.required),
mainCanopy: new FormControl("", [
Validators.required,
Validators.min(60),
Validators.max(320)
Validators.max(320),
]),
reserveCanopy: new FormControl("", [
Validators.required,
Validators.min(60),
Validators.max(320)
])
Validators.max(320),
]),
},
{ updateOn: "blur" }
);
}
ngOnInit() { }
ngOnInit() {}
onSubmit(formData) {
this.serviceApi.addGear(formData.name,
formData.manufacturer,
+formData.minSize,
+formData.maxSize,
formData.aad,
formData.mainCanopy,
formData.reserveCanopy)
.subscribe(() => {
this.serviceComm.refreshData(AddAction.Gear);
});
this.serviceApi
.addGear(
formData.name,
formData.manufacturer,
+formData.minSize,
+formData.maxSize,
formData.aad,
formData.mainCanopy,
formData.reserveCanopy
)
.subscribe(() => {
this.serviceComm.refreshData(AddAction.Gear);
});
}
}