Added alert and textarea cleaning after send.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
RakVhalate 2022-11-08 04:42:47 +10:00
parent ced76ed70c
commit 85fdc0164f
4 changed files with 6 additions and 3 deletions

Binary file not shown.

View File

@ -11,7 +11,7 @@ import { SinglePost } from '../models/post'
export class BoardsComponent implements OnInit {
command: string = "";
response: any;
postsToShow: SinglePost[] = [] //products: Iproduct[] = data
postsToShow: SinglePost[] = []
constructor(public apiChatService: ApiChatService) {

View File

@ -2,10 +2,10 @@
<h4>Поведай миру что-нибудь хорошее.</h4>
<textarea type="text" rows="8" cols="45" placeholder="Печатать сюда" #textToPost> </textarea>
<p>
<button (click)="sendPost(textToPost.value)">Отправить</button>
<button (click)="sendPost(textToPost.value) ; textToPost.value=''" >Отправить</button>
</p>
<h1>Загрузить картинку:</h1>
<input type="file" #file placeholder="Загрузить картинку" (change)="sendPic($event)" style="display:none;">
<button type="button" class="btn btn-success" (click)="file.click()">Загрузить картинку</button>
<p>Картинка в статике: {{filename}}</p>
<p>Картинка: {{filename}}</p>
</div>

View File

@ -23,6 +23,9 @@ export class SendPostComponent implements OnInit {
sendPost(text: string) {
this.apiChatService.sendPostToApi(text, this.filename).subscribe();
this.message = '0';
this.filename = '0';
alert("Сообщение отправлено.");
}
sendPic(event: any) {