update form from create book
This commit is contained in:
@@ -1,33 +1,37 @@
|
||||
<form nz-form nzLayout="horizontal" [formGroup]="authorForm" (ngSubmit)="submitForm()">
|
||||
<form nz-form nzLayout="horizontal" [formGroup]="createBookForm" (ngSubmit)="submitForm()">
|
||||
<nz-form-item>
|
||||
<nz-form-label nzSpan="4" nzRequired>
|
||||
Nom
|
||||
Titre
|
||||
</nz-form-label>
|
||||
|
||||
<nz-form-control nzSpan="20" nzErrorTip="Ce champ est requis">
|
||||
<input nz-input placeholder="Nom" formControlName="name">
|
||||
<input nz-input placeholder="Titre du livre" formControlName="title">
|
||||
</nz-form-control>
|
||||
</nz-form-item>
|
||||
|
||||
<nz-form-item>
|
||||
<nz-form-label nzSpan="4" nzRequired>
|
||||
Prénom
|
||||
Date de publication
|
||||
</nz-form-label>
|
||||
|
||||
<nz-form-control nzSpan="20" nzErrorTip="Ce champ est requis">
|
||||
<input nz-input placeholder="Prénom" formControlName="firstname">
|
||||
<input nz-input type="number" placeholder="2005" formControlName="releaseYear">
|
||||
</nz-form-control>
|
||||
</nz-form-item>
|
||||
|
||||
<nz-form-item>
|
||||
<nz-form-label nzSpan="4" nzRequired>
|
||||
Auteur
|
||||
</nz-form-label>
|
||||
|
||||
<nz-form-control nzSpan="20" nzErrorTip="Ce champ est requis">
|
||||
<input nz-input placeholder="Auteur" formControlName="author">
|
||||
</nz-form-control>
|
||||
</nz-form-item>
|
||||
|
||||
<nz-flex nzJustify="end">
|
||||
<!-- <button nz-button nzType="primary" (click)="submitForm()">-->
|
||||
<!-- Valider-->
|
||||
<!-- </button>-->
|
||||
|
||||
<button nz-button nzType="primary" type="submit">
|
||||
<button nz-button nzType="primary" (click)="submitForm()">
|
||||
Valider
|
||||
</button>
|
||||
</nz-flex>
|
||||
</form>
|
||||
|
||||
<button nz-button (click)="fillForm()">Simuler une récupération depuis le serveur</button>
|
||||
</form>
|
||||
@@ -1,10 +1,11 @@
|
||||
import { Component } from '@angular/core';
|
||||
import {NzFormModule} from "ng-zorro-antd/form";
|
||||
import {FormControl, FormGroup, Validators} from "@angular/forms";
|
||||
import {FormControl, FormGroup, ReactiveFormsModule, Validators} from "@angular/forms";
|
||||
import {NzFlexDirective} from "ng-zorro-antd/flex";
|
||||
|
||||
@Component({
|
||||
selector: 'app-create-book',
|
||||
imports: [NzFormModule],
|
||||
imports: [NzFormModule, ReactiveFormsModule, NzFlexDirective],
|
||||
templateUrl: './create-book.html',
|
||||
styleUrl: './create-book.css',
|
||||
})
|
||||
|
||||
@@ -2,4 +2,6 @@
|
||||
|
||||
<h1 class="text-3xl font-bold underline">
|
||||
Hello world!
|
||||
</h1>
|
||||
</h1>
|
||||
|
||||
<app-create-book></app-create-book>
|
||||
@@ -1,8 +1,11 @@
|
||||
import { Component } from '@angular/core';
|
||||
import {CreateBook} from "../../components/create-book/create-book";
|
||||
|
||||
@Component({
|
||||
selector: 'app-welcome',
|
||||
imports: [],
|
||||
imports: [
|
||||
CreateBook
|
||||
],
|
||||
templateUrl: './welcome.html',
|
||||
styleUrl: './welcome.css'
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user