diff --git a/src/app/components/create-author/create-author.html b/src/app/components/create-author/create-author.html index acb00ec..53de714 100644 --- a/src/app/components/create-author/create-author.html +++ b/src/app/components/create-author/create-author.html @@ -1,4 +1,4 @@ -
+ Nom diff --git a/src/app/components/create-author/create-author.ts b/src/app/components/create-author/create-author.ts index 857b7a2..6c7bb5b 100644 --- a/src/app/components/create-author/create-author.ts +++ b/src/app/components/create-author/create-author.ts @@ -2,6 +2,7 @@ import {Component, input} from '@angular/core'; import {FormControl, FormGroup, FormsModule, ReactiveFormsModule, Validators} from "@angular/forms"; import {NzColDirective, NzRowDirective} from "ng-zorro-antd/grid"; import {NzFormControlComponent, NzFormDirective, NzFormItemComponent, NzFormLabelComponent} from "ng-zorro-antd/form"; +import {NzInputDirective} from "ng-zorro-antd/input"; @Component({ selector: 'app-create-author', @@ -13,7 +14,8 @@ import {NzFormControlComponent, NzFormDirective, NzFormItemComponent, NzFormLabe NzFormItemComponent, NzFormLabelComponent, NzRowDirective, - ReactiveFormsModule + ReactiveFormsModule, + NzInputDirective ], templateUrl: './create-author.html', styleUrl: './create-author.css', @@ -23,15 +25,4 @@ export class CreateAuthor { name: new FormControl(null, [Validators.required]), firstName: new FormControl(null, [Validators.required]) }) - - submitForm() { - // Pour annuler si le formulaire est invalide - if (this.createAuthorForm.invalid) return; - - // Pour obtenir la valeur du formulaire - console.log(this.createAuthorForm.getRawValue()) - - // Pour vider le formulaire - this.createAuthorForm.reset() - } } diff --git a/src/app/components/update-author/update-author.ts b/src/app/components/update-author/update-author.ts index 04b16d0..d90e408 100644 --- a/src/app/components/update-author/update-author.ts +++ b/src/app/components/update-author/update-author.ts @@ -3,6 +3,7 @@ import {FormControl, FormGroup, FormsModule, ReactiveFormsModule, Validators} fr import {NzColDirective, NzRowDirective} from "ng-zorro-antd/grid"; import {NzFormControlComponent, NzFormDirective, NzFormItemComponent, NzFormLabelComponent} from "ng-zorro-antd/form"; import {GetAuthorDto, GetLoanDto} from "../../services/api"; +import {NzInputDirective} from "ng-zorro-antd/input"; @Component({ selector: 'app-update-author', @@ -14,7 +15,8 @@ import {GetAuthorDto, GetLoanDto} from "../../services/api"; NzFormItemComponent, NzFormLabelComponent, NzRowDirective, - ReactiveFormsModule + ReactiveFormsModule, + NzInputDirective ], templateUrl: './update-author.html', styleUrl: './update-author.css', diff --git a/src/app/pages/author/author.ts b/src/app/pages/author/author.ts index 88c8cbe..08fb6a1 100644 --- a/src/app/pages/author/author.ts +++ b/src/app/pages/author/author.ts @@ -49,7 +49,7 @@ export class Author{ this.notificationService.success( 'Success', - 'Utilisateur crée' + 'Auteur enregistré' ) } catch (e) { this.notificationService.error(