diff --git a/src/app/components/comment-form/comment-form.component.css b/src/app/components/comment-form/comment-form.component.css index e69de29..a13e8c5 100644 --- a/src/app/components/comment-form/comment-form.component.css +++ b/src/app/components/comment-form/comment-form.component.css @@ -0,0 +1,5 @@ +.textarea { + width: 50rem; + height: 8rem; + resize: none; +} diff --git a/src/app/components/comment-form/comment-form.component.html b/src/app/components/comment-form/comment-form.component.html index 5634ab0..b414a70 100644 --- a/src/app/components/comment-form/comment-form.component.html +++ b/src/app/components/comment-form/comment-form.component.html @@ -1 +1,4 @@ -
comment-form works!
+ diff --git a/src/app/components/comment-form/comment-form.component.ts b/src/app/components/comment-form/comment-form.component.ts index eb8d5fb..60138cc 100644 --- a/src/app/components/comment-form/comment-form.component.ts +++ b/src/app/components/comment-form/comment-form.component.ts @@ -1,12 +1,77 @@ -import { Component } from '@angular/core'; +import {Component, EventEmitter, Input, Output} from '@angular/core'; +import {FormControl, FormGroup, ReactiveFormsModule, Validators} from '@angular/forms'; +import {InputTextareaModule} from 'primeng/inputtextarea'; +import {Button} from 'primeng/button'; +import {CommentService} from '../../services/comment.service'; +import {CookieService} from 'ngx-cookie-service'; +import {Author} from '../../models/author'; +import {Subscription} from 'rxjs'; +import {Comment} from '../../models/comment'; +import {MessageService} from 'primeng/api'; @Component({ selector: 'app-comment-form', standalone: true, - imports: [], + imports: [ + ReactiveFormsModule, + InputTextareaModule, + Button + ], templateUrl: './comment-form.component.html', styleUrl: './comment-form.component.css' }) export class CommentFormComponent { + commentForm = new FormGroup({ + content: new FormControl{{ category }}
- Publié le {{ date | date : "dd/MM/yyyy à HH:mm" }} -{{ description }}
-Mis à jour le {{ comment.commentDate | date: "dd/MM/yyyy à HH:mm" }}
- } @else { -Envoyé le {{ comment.commentDate | date: "dd/MM/yyyy à HH:mm" }}
- } -{{ comment.content }}
- } -Mis à jour le {{ comment.commentDate | date: "dd/MM/yyyy à HH:mm" }}
+ } @else { +Envoyé le {{ comment.commentDate | date: "dd/MM/yyyy à HH:mm" }}
+ } +Mis à jour le {{ comment.commentDate | date: "dd/MM/yyyy à HH:mm" }}
+ } @else { +Envoyé le {{ comment.commentDate | date: "dd/MM/yyyy à HH:mm" }}
+ } +{{ comment.content }}
+ } +
- {{ comment.authorRole }}
- @if (comment.isUpdated) { -Mis à jour le {{ comment.commentDate | date: "dd/MM/yyyy à HH:mm" }}
- } @else { -Envoyé le {{ comment.commentDate | date: "dd/MM/yyyy à HH:mm" }}
- } -