added form into vue to send message
This commit is contained in:
@@ -1,3 +1,8 @@
|
||||
<p>
|
||||
message-form works!
|
||||
</p>
|
||||
<form [formGroup]="messageForm" class="relative">
|
||||
<ion-item lines="none" class="rounded-2xl border border-stone-200 fixed bottom-4 left-4 right-4">
|
||||
<ion-input placeholder="Envoyer un message ..." formControlName="libelle"></ion-input>
|
||||
<ion-button style="--background: white">
|
||||
<ion-icon name="send-outline" class="text-xl text-stone-400"></ion-icon>
|
||||
</ion-button>
|
||||
</ion-item>
|
||||
</form>
|
||||
|
||||
@@ -1,16 +1,23 @@
|
||||
import {Component, OnInit} from '@angular/core';
|
||||
import {Component} from '@angular/core';
|
||||
import {IonicModule} from "@ionic/angular";
|
||||
import {FormControl, FormGroup, ReactiveFormsModule, Validators} from "@angular/forms";
|
||||
import {addIcons} from "ionicons";
|
||||
import {sendOutline} from 'ionicons/icons';
|
||||
addIcons({
|
||||
"send-outline" : sendOutline
|
||||
})
|
||||
|
||||
@Component({
|
||||
selector: 'app-message-form',
|
||||
templateUrl: './message-form.component.html',
|
||||
styleUrls: ['./message-form.component.scss'],
|
||||
imports: [
|
||||
IonicModule,
|
||||
ReactiveFormsModule
|
||||
]
|
||||
})
|
||||
export class MessageFormComponent implements OnInit {
|
||||
|
||||
constructor() {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
}
|
||||
|
||||
export class MessageFormComponent {
|
||||
messageForm: FormGroup = new FormGroup({
|
||||
libelle: new FormControl<string>(null, [Validators.required]),
|
||||
})
|
||||
}
|
||||
|
||||
@@ -50,6 +50,7 @@
|
||||
@if (groupSelected()) {
|
||||
<app-modal>
|
||||
<app-message [groupId]="groupSelected().id"></app-message>
|
||||
<app-message-form></app-message-form>
|
||||
</app-modal>
|
||||
}
|
||||
</ion-content>
|
||||
|
||||
@@ -29,6 +29,7 @@ import {GroupsComponent} from "../../components/groups/groups.component";
|
||||
import {GroupFormComponent} from "../../components/group-form/group-form.component";
|
||||
import {GroupInfoComponent} from "../../components/group-info/group-info.component";
|
||||
import {MessageComponent} from "../../components/message/message.component";
|
||||
import {MessageFormComponent} from "../../components/message-form/message-form.component";
|
||||
|
||||
addIcons({
|
||||
'profile': personOutline,
|
||||
@@ -61,6 +62,7 @@ type View = 'menu' | 'profile' | 'password' | 'designation' | 'gallery' | 'group
|
||||
GroupFormComponent,
|
||||
GroupInfoComponent,
|
||||
MessageComponent,
|
||||
MessageFormComponent,
|
||||
]
|
||||
})
|
||||
export class HomeComponent implements OnInit {
|
||||
|
||||
Reference in New Issue
Block a user