Added alert and textarea cleaning after send.
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
ced76ed70c
commit
85fdc0164f
BIN
.vs/slnx.sqlite
BIN
.vs/slnx.sqlite
Binary file not shown.
@ -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) {
|
||||
|
||||
|
@ -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>
|
||||
|
@ -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) {
|
||||
|
Reference in New Issue
Block a user