update Angular to v20
Reviewed-on: #4 Co-authored-by: sandre <perso@sebastienandre.com> Co-committed-by: sandre <perso@sebastienandre.com>
This commit was merged in pull request #4.
This commit is contained in:
@@ -1,34 +1,36 @@
|
||||
<form (ngSubmit)="updateJump()">
|
||||
<p>
|
||||
<span>Gear : {{ jump.gear.name }} ({{ jump.gear.mainCanopy }})</span>
|
||||
</p>
|
||||
<p>
|
||||
<mat-checkbox
|
||||
[(ngModel)]="jump.isSpecial"
|
||||
name="isSpecial"
|
||||
labelPosition="before"
|
||||
>Special jump</mat-checkbox
|
||||
>
|
||||
</p>
|
||||
<p>
|
||||
<mat-checkbox
|
||||
[(ngModel)]="jump.withCutaway"
|
||||
name="withCutaway"
|
||||
labelPosition="before"
|
||||
>Cutaway</mat-checkbox
|
||||
>
|
||||
</p>
|
||||
<mat-form-field>
|
||||
<textarea
|
||||
matInput
|
||||
placeholder="Comments"
|
||||
name="comments"
|
||||
[(ngModel)]="jump.notes"
|
||||
name="comments"
|
||||
type="text"
|
||||
></textarea>
|
||||
</mat-form-field>
|
||||
<p>
|
||||
<span>Gear : {{ jump.gear.name }} ({{ jump.gear.mainCanopy }})</span>
|
||||
</p>
|
||||
<p>
|
||||
<mat-checkbox
|
||||
[(ngModel)]="jump.isSpecial"
|
||||
name="isSpecial"
|
||||
labelPosition="before"
|
||||
>Special jump</mat-checkbox
|
||||
>
|
||||
</p>
|
||||
<p>
|
||||
<mat-checkbox
|
||||
[(ngModel)]="jump.withCutaway"
|
||||
name="withCutaway"
|
||||
labelPosition="before"
|
||||
>Cutaway</mat-checkbox
|
||||
>
|
||||
</p>
|
||||
<mat-form-field>
|
||||
<textarea
|
||||
matInput
|
||||
placeholder="Comments"
|
||||
name="comments"
|
||||
[(ngModel)]="jump.notes"
|
||||
name="comments"
|
||||
type="text"
|
||||
></textarea>
|
||||
</mat-form-field>
|
||||
|
||||
<br />
|
||||
<button mat-raised-button color="accent" *ngIf="editMode">Update</button>
|
||||
<br />
|
||||
@if (editMode) {
|
||||
<button mat-raised-button color="accent">Update</button>
|
||||
}
|
||||
</form>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Component, Inject, OnInit } from "@angular/core";
|
||||
import { CommonModule } from "@angular/common";
|
||||
|
||||
import { MAT_DIALOG_DATA } from "@angular/material/dialog";
|
||||
import { TranslateModule } from "@ngx-translate/core";
|
||||
import { MatCheckboxModule } from "@angular/material/checkbox";
|
||||
@@ -15,45 +15,44 @@ import { JumpService } from "../../services/jump.service";
|
||||
import { ServiceComm } from "../../services/service-comm.service";
|
||||
|
||||
@Component({
|
||||
selector: "app-jump-infos",
|
||||
templateUrl: "./jump-infos.component.html",
|
||||
styleUrls: ["./jump-infos.component.css"],
|
||||
imports: [
|
||||
TranslateModule,
|
||||
CommonModule,
|
||||
FormsModule,
|
||||
MatCheckboxModule,
|
||||
MatFormFieldModule,
|
||||
ReactiveFormsModule,
|
||||
MatInputModule,
|
||||
MatButtonModule,
|
||||
],
|
||||
selector: "app-jump-infos",
|
||||
templateUrl: "./jump-infos.component.html",
|
||||
styleUrls: ["./jump-infos.component.css"],
|
||||
imports: [
|
||||
TranslateModule,
|
||||
FormsModule,
|
||||
MatCheckboxModule,
|
||||
MatFormFieldModule,
|
||||
ReactiveFormsModule,
|
||||
MatInputModule,
|
||||
MatButtonModule,
|
||||
],
|
||||
})
|
||||
export class JumpInfosComponent implements OnInit {
|
||||
public editMode: boolean;
|
||||
public jump: JumpResp;
|
||||
public editMode: boolean;
|
||||
public jump: JumpResp;
|
||||
|
||||
constructor(
|
||||
@Inject(MAT_DIALOG_DATA) public data: any,
|
||||
private serviceJump: JumpService,
|
||||
private serviceComm: ServiceComm
|
||||
) {
|
||||
this.jump = new JumpResp(data.jump);
|
||||
this.editMode = data.editMode;
|
||||
}
|
||||
constructor(
|
||||
@Inject(MAT_DIALOG_DATA) public data: any,
|
||||
private serviceJump: JumpService,
|
||||
private serviceComm: ServiceComm,
|
||||
) {
|
||||
this.jump = new JumpResp(data.jump);
|
||||
this.editMode = data.editMode;
|
||||
}
|
||||
|
||||
ngOnInit(): void {}
|
||||
ngOnInit(): void {}
|
||||
|
||||
public updateJump() {
|
||||
this.serviceJump
|
||||
.updateJump(
|
||||
this.jump.id,
|
||||
this.jump.isSpecial,
|
||||
this.jump.withCutaway,
|
||||
this.jump.notes
|
||||
)
|
||||
.subscribe(() => {
|
||||
this.serviceComm.refreshData(AddAction.Jump);
|
||||
});
|
||||
}
|
||||
public updateJump() {
|
||||
this.serviceJump
|
||||
.updateJump(
|
||||
this.jump.id,
|
||||
this.jump.isSpecial,
|
||||
this.jump.withCutaway,
|
||||
this.jump.notes,
|
||||
)
|
||||
.subscribe(() => {
|
||||
this.serviceComm.refreshData(AddAction.Jump);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user